[syslinux:master] com32: Adding 'exit' entry in chain.c32

syslinux-bot for Erwan Velu erwanaliasr1 at gmail.com
Tue Dec 8 16:27:04 PST 2015


Commit-ID:  dc89161d7838eef43b07a073a81ceafa2e372dcc
Gitweb:     http://www.syslinux.org/commit/dc89161d7838eef43b07a073a81ceafa2e372dcc
Author:     Erwan Velu <erwanaliasr1 at gmail.com>
AuthorDate: Tue, 1 Dec 2015 20:53:01 +0100
Committer:  Gene Cumm <gene.cumm at gmail.com>
CommitDate: Sun, 6 Dec 2015 15:18:50 -0500

com32: Adding 'exit' entry in chain.c32

This patch is coming after some bad experience with gfxboot.
GFXboot was padding unexpected options on the chain.c32 commande line.
As a result, chain was confused and didn't provided the expected
behavior.

This patch is a workaround to enforce chain.c32 not considering anything
on the command line after this keyword.

Example:

chain.c32 hd0 exit ...garbage...

---
 com32/chain/options.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/com32/chain/options.c b/com32/chain/options.c
index 2b51939..e9c4a62 100644
--- a/com32/chain/options.c
+++ b/com32/chain/options.c
@@ -138,6 +138,7 @@ static void usage(void)
 "                       - strict w/o any value is the same as strict=2",
 "  relax                The same as strict=0",
 "  prefmbr              On hybrid MBR/GPT disks, prefer legacy layout",
+"  exit                 Don't read anything after this keyword",
 "",
 "  file=<file>          Load and execute <file>",
 "  seg=<s[:o[:i]]>      Load file at <s:o>, jump to <s:i>",
@@ -194,6 +195,8 @@ int opt_parse_args(int argc, char *argv[])
     for (i = 1; i < argc; i++) {
 	if (!strncmp(argv[i], "file=", 5)) {
 	    opt.file = argv[i] + 5;
+	} else if (!strncmp(argv[i], "exit", 4)) {
+	    break;
 	} else if (!strcmp(argv[i], "nofile")) {
 	    opt.file = NULL;
 	} else if (!strncmp(argv[i], "seg=", 4)) {


More information about the Syslinux-commits mailing list