aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErwan Velu <erwanaliasr1@gmail.com>2015-12-01 20:53:01 +0100
committerGene Cumm <gene.cumm@gmail.com>2015-12-06 15:18:50 -0500
commitdc89161d7838eef43b07a073a81ceafa2e372dcc (patch)
tree1863903d5e21260d1bc52ffa06a7bffc543ec01d
parenta35e34b7fa47a62df711c49832f46d6edf790381 (diff)
downloadsyslinux-dc89161d7838eef43b07a073a81ceafa2e372dcc.tar.gz
syslinux-dc89161d7838eef43b07a073a81ceafa2e372dcc.tar.xz
syslinux-dc89161d7838eef43b07a073a81ceafa2e372dcc.zip
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...
-rw-r--r--com32/chain/options.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/com32/chain/options.c b/com32/chain/options.c
index 2b519394..e9c4a627 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)) {