[syslinux] SYSAPPEND not replacing spaces

Dany St-Amant dany.ephemeral.2014 at icloud.com
Wed Nov 5 07:11:30 PST 2014


Hello,

The description of SYSAPPEND for the DMI information states that the spaces are replaced by underscores, but this replacement does not occur in 6.03. There's small bug present in triplicata in com32/elflink/ldlinux/readconfig.c:copy_sysappend_string(), com32/menu/readconfig.c:copy_sysappend_string(), and core/sysappend.c:copy_and_mangle() prevent proper replacement of spaces by underscore.

Here's a patch which fix this (only tested via BIOS PXELINUX)

diff -pruN syslinux-6.03.orig/com32/elflink/ldlinux/readconfig.c syslinux-6.03.d
mi/com32/elflink/ldlinux/readconfig.c
--- syslinux-6.03.orig/com32/elflink/ldlinux/readconfig.c       2014-10-06 12:27
:44.000000000 -0400
+++ syslinux-6.03.dmi/com32/elflink/ldlinux/readconfig.c        2014-11-05 10:02
:10.000000000 -0500
@@ -330,7 +330,7 @@ static char *copy_sysappend_string(char 
     char c;
 
     while ((c = *src++)) {
-       if (c <= ' ' && c == '\x7f') {
+       if (c <= ' ' || c == '\x7f') {
            if (!was_space)
                *dst++ = '_';
            was_space = true;
diff -pruN syslinux-6.03.orig/com32/menu/readconfig.c syslinux-6.03.dmi/com32/me
nu/readconfig.c
--- syslinux-6.03.orig/com32/menu/readconfig.c  2014-10-06 12:27:44.000000000 -0
400
+++ syslinux-6.03.dmi/com32/menu/readconfig.c   2014-11-05 08:44:00.000000000 -0
500
@@ -299,7 +299,7 @@ static char *copy_sysappend_string(char 
     char c;
 
     while ((c = *src++)) {
-       if (c <= ' ' && c == '\x7f') {
+       if (c <= ' ' || c == '\x7f') {
            if (!was_space)
                *dst++ = '_';
            was_space = true;
diff -pruN syslinux-6.03.orig/core/sysappend.c syslinux-6.03.dmi/core/sysappend.
c
--- syslinux-6.03.orig/core/sysappend.c 2014-10-06 12:27:44.000000000 -0400
+++ syslinux-6.03.dmi/core/sysappend.c  2014-11-04 19:13:30.000000000 -0500
@@ -35,7 +35,7 @@ static char *copy_and_mangle(char *dst, 
     char c;
 
     while ((c = *src++)) {
-       if (c <= ' ' && c == '\x7f') {
+       if (c <= ' ' || c == '\x7f') {
            if (!was_space)
                *dst++ = '_';
            was_space = true;



Regards,
Dany St-Amant


More information about the Syslinux mailing list