Skip to content

Commit

Permalink
com32: Adding 'exit' entry in chain.c32
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
ErwanAliasr1 authored and geneC committed Dec 6, 2015
1 parent a35e34b commit dc89161
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions com32/chain/options.c
Expand Up @@ -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>",
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit dc89161

Please sign in to comment.