summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2006-09-22 17:07:17 -0700
committerH. Peter Anvin <hpa@zytor.com>2006-09-22 17:07:17 -0700
commita584b423450923389f4dc25480e30472c8641d38 (patch)
tree3419562a11a14ce1bba071705da0f792a891d6cc
parent189d58983b71e5525c55aefbc4fd97bc87b5b29f (diff)
downloadsyslinux-3.31.tar.gz
Try to be more true to the way "MENU INCLUDE" should work.syslinux-3.31-pre4syslinux-3.31
-rw-r--r--com32/modules/readconfig.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/com32/modules/readconfig.c b/com32/modules/readconfig.c
index 33326f6e..a0a78420 100644
--- a/com32/modules/readconfig.c
+++ b/com32/modules/readconfig.c
@@ -362,19 +362,19 @@ static uint32_t parse_argb(char **p)
}
/*
- * Global APPEND and IPAPPEND status
+ * Parser state. This is global so that including multiple
+ * files work as expected, which is that everything works the
+ * same way as if the files had been concatenated together.
*/
static char *append = NULL;
static unsigned int ipappend = 0;
+static struct labeldata ld;
static int parse_one_config(const char *filename);
static void parse_config_file(FILE *f)
{
char line[MAX_LINE], *p, *ep, ch;
- struct labeldata ld;
-
- memset(&ld, 0, sizeof ld);
while ( fgets(line, sizeof line, f) ) {
p = strchr(line, '\r');
@@ -515,8 +515,6 @@ static void parse_config_file(FILE *f)
ld.append = strdup(skipspace(p+9));
}
}
-
- record(&ld, append);
}
static int parse_one_config(const char *filename)
@@ -549,6 +547,10 @@ void parse_configs(char **argv)
parse_one_config(filename);
}
+ /* On final EOF process the last label statement */
+
+ record(&ld, append);
+
/* Common postprocessing */
if ( ontimeout )