From dc89161d7838eef43b07a073a81ceafa2e372dcc Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Tue, 1 Dec 2015 20:53:01 +0100 Subject: 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 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= Load and execute ", " seg= Load file at , jump to ", @@ -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)) { -- cgit v1.2.1