aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/ldlinux/readconfig.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@linux.intel.com>2011-03-09 14:20:19 +0000
committerMatt Fleming <matt.fleming@linux.intel.com>2011-03-09 14:32:36 +0000
commit9ded45991b4fc83b40af963feb773ddca2589d74 (patch)
treed538d93d7b9040a0582c7382bf45dbf84e415fcd /com32/elflink/ldlinux/readconfig.c
parent5c907b4f4fbbe9ee565aa4fdfec6ae9be6d28580 (diff)
downloadsyslinux-9ded45991b4fc83b40af963feb773ddca2589d74.tar.gz
syslinux-9ded45991b4fc83b40af963feb773ddca2589d74.tar.xz
syslinux-9ded45991b4fc83b40af963feb773ddca2589d74.zip
ldlinux: Parse and store the "onerror" command line
If we fail to load a kernel and the parser found an "onerror" directive, execute the onerror command line. Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
Diffstat (limited to 'com32/elflink/ldlinux/readconfig.c')
-rw-r--r--com32/elflink/ldlinux/readconfig.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/com32/elflink/ldlinux/readconfig.c b/com32/elflink/ldlinux/readconfig.c
index ed498ff4..898ee19a 100644
--- a/com32/elflink/ldlinux/readconfig.c
+++ b/com32/elflink/ldlinux/readconfig.c
@@ -60,6 +60,7 @@ short displaycon = 1; //conio.inc
short nohalt = 1; //idle.inc
char *default_cmd = NULL; //"default" command line
+char *onerror = NULL; //"onerror" command line
/* Empty refstring */
const char *empty_string;
@@ -703,6 +704,8 @@ static void parse_config_file(FILE * f)
refstr_put(m->onerror);
m->onerror = refstrdup(skipspace(p + 7));
onerrorlen = strlen(m->onerror);
+ refstr_put(onerror);
+ onerror = refstrdup(m->onerror);
} else if (looking_at(p, "master")) {
p = skipspace(p + 6);
if (looking_at(p, "passwd")) {
@@ -1030,6 +1033,12 @@ do_include:
nocomplete = atoi(skipspace(p + 10));
} else if (looking_at(p, "nohalt")) {
nohalt = atoi(skipspace(p + 8));
+ } else if (looking_at(p, "onerror")) {
+ refstr_put(m->onerror);
+ m->onerror = refstrdup(skipspace(p + 7));
+ onerrorlen = strlen(m->onerror);
+ refstr_put(onerror);
+ onerror = refstrdup(m->onerror);
}
/* serial setting, bps, flow control */