diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-11-26 13:13:07 +0000 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-11-26 13:21:34 +0000 |
commit | 376a2122c7470799a92c27cace1d455e8c29f05a (patch) | |
tree | c7803e6788c1277f0b10c4c73d0175f2f178dab9 | |
parent | 390ec0fa8881da48852e6693df6d5cada6031235 (diff) | |
download | syslinux-376a2122c7470799a92c27cace1d455e8c29f05a.tar.gz syslinux-376a2122c7470799a92c27cace1d455e8c29f05a.tar.xz syslinux-376a2122c7470799a92c27cace1d455e8c29f05a.zip |
ldlinux: Fix OnError behaviour
If the ONERROR directive references a label we need to lookup the
label's command line and type.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r-- | com32/elflink/ldlinux/ldlinux.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c index d3f8e627..4a092838 100644 --- a/com32/elflink/ldlinux/ldlinux.c +++ b/com32/elflink/ldlinux/ldlinux.c @@ -201,8 +201,14 @@ bad_kernel: * line. */ if (onerrorlen) { - rsprintf(&cmdline, "%s %s", onerror, default_cmd); - execute(cmdline, IMAGE_TYPE_COM32); + me = find_label(onerror); + if (me) + rsprintf(&cmdline, "%s %s", me->cmdline, default_cmd); + else + rsprintf(&cmdline, "%s %s", onerror, default_cmd); + + type = parse_image_type(cmdline); + execute(cmdline, type); } } |