From 786cf865080ac907b75fbe74ead290fff9efb718 Mon Sep 17 00:00:00 2001 From: kraxel Date: Thu, 10 Jun 2004 07:31:54 +0000 Subject: - fix command line parsing. --- fbiconfig.c | 2 +- parseconfig.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fbiconfig.c b/fbiconfig.c index 249a5ab..9bae367 100644 --- a/fbiconfig.c +++ b/fbiconfig.c @@ -36,7 +36,7 @@ struct cfg_cmdline fbi_cmd[] = { .letter = 'P', .cmdline = "text", .option = { O_TEXT_MODE }, - .needsarg = 1, + .value = "1", .desc = "switch into text reading mode", },{ .letter = 'a', diff --git a/parseconfig.c b/parseconfig.c index e7a0e0a..60847c3 100644 --- a/parseconfig.c +++ b/parseconfig.c @@ -373,7 +373,8 @@ cfg_parse_cmdline(int *argc, char **argv, struct cfg_cmdline *opt) 1); shift = 1; - } else if (opt[o].needsarg && sopt && sopt == opt[o].letter) { + } else if (opt[o].needsarg && sopt && sopt == opt[o].letter && + i+1 < *argc) { /* arg: -f bar */ cfg_set_str(opt[o].option.domain, opt[o].option.section, -- cgit