[syslinux] Patch: Readconfig wont parse certain options anymore

Ram Yalamanchili ramyinc at gmail.com
Thu Feb 22 20:52:14 PST 2007


com32/modules/readconfig.c: This is a side effect of is_kernel_type()
overwrite the current pointer in a loop context. Hence subsequent
options aren't parsed ever.

This is particularily visible, if you use timeout option, which wont
work in the latest 3.40-pre7.

Patch:
--- com32/modules/readconfig.c
/opensource/syslinux-3.40-pre7/com32/modules/readconfig.c#2
+++ com32/modules/readconfig.c  07-02-22 20:45:46
@@ -412,7 +412,7 @@

 static void parse_config_file(FILE *f)
 {
-  char line[MAX_LINE], *p, *ep, ch;
+  char line[MAX_LINE], *p, *kp, *ep, ch;
   enum kernel_type type;

   while ( fgets(line, sizeof line, f) ) {
@@ -532,10 +532,10 @@
       ld.menulabel = NULL;
       ld.ipappend  = ipappend;
       ld.menudefault = ld.menuhide = 0;
-    } else if ( (p = is_kernel_type(p, &type)) ) {
+    } else if ( (kp = is_kernel_type(p, &type)) ) {
       if ( ld.label ) {
        free(ld.kernel);
-       ld.kernel = strdup(skipspace(p));
+       ld.kernel = strdup(skipspace(kp));
        ld.type = type;
       }
     } else if ( looking_at(p, "timeout") ) {




More information about the Syslinux mailing list