[syslinux] boot... round 2
Thomas Schmitt
scdbackup at gmx.net
Thu Jul 2 02:10:50 PDT 2015
Hi,
poma wrote:
> - if (c <= ' ' || c == '\x7f') {
> + if (c <= ' ' && c == '\x7f') {
As Geert Stappers pointed out (and can be verified by a
simple test program), the reinstated term
(c <= ' ' && c == '\x7f')
evaluates always as false, because ('\x7f' <= ' ') is false.
So it is equivalent to removing the code branch
if (!was_space)
*dst++ = '_';
was_space = true;
I understand the function shall convert whitespace to '_',
condense groups of neighboring whitespaces to a single '_',
discard leading and trailing whitespace.
In its current git state it converts
"abc" -> "abc"
" abc " -> "abc"
" a b c " -> "a_b_c"
The change to
(c <= " " && c == "\x7f")
disables this conversion completely.
" a b c " -> " a b c "
It seems your use case needs the whitespaces whereas SYSLINUX
assumes that they are unwanted.
This collision of need and software model needs to be
investigated and solved.
Have a nice day :)
Thomas
More information about the Syslinux
mailing list