[syslinux:elflink] ldlinux: Fix OnError behaviour

syslinux-bot for Matt Fleming matt.fleming at intel.com
Mon Nov 26 05:27:04 PST 2012


Commit-ID:  376a2122c7470799a92c27cace1d455e8c29f05a
Gitweb:     http://www.syslinux.org/commit/376a2122c7470799a92c27cace1d455e8c29f05a
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Mon, 26 Nov 2012 13:13:07 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Mon, 26 Nov 2012 13:21:34 +0000

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 at intel.com>

---
 com32/elflink/ldlinux/ldlinux.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c
index d3f8e62..4a09283 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);
 	}
 }
 


More information about the Syslinux-commits mailing list