menu.c32: Fix SYSAPPEND
authorGene Cumm <gene.cumm@gmail.com>
Mon, 24 Jun 2013 03:30:51 +0000 (23:30 -0400)
committerGene Cumm <gene.cumm@gmail.com>
Mon, 24 Jun 2013 03:30:51 +0000 (23:30 -0400)
Using the SYSAPPEND directive would examine "D" instead of the
value after the directive.  Also allows a 1-step switch to strtol()

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
com32/menu/readconfig.c

index 7eaea28..adec8a7 100644 (file)
@@ -1044,11 +1044,13 @@ do_include:
            m->ontimeout = refstrdup(skipspace(p + 9));
        } else if (looking_at(p, "allowoptions")) {
            m->allowedit = !!atoi(skipspace(p + 12));
-       } else if (looking_at(p, "ipappend") || looking_at(p, "sysappend")) {
+       } else if ((ep = looking_at(p, "ipappend")) ||
+                  (ep = looking_at(p, "sysappend"))) {
+           uint32_t s = atoi(skipspace(ep));
            if (ld.label)
-               ld.ipappend = atoi(skipspace(p + 8));
+               ld.ipappend = s;
            else
-               ipappend = atoi(skipspace(p + 8));
+               ipappend = s;
        } else if (looking_at(p, "default")) {
            refstr_put(globaldefault);
            globaldefault = refstrdup(skipspace(p + 7));