From 2f62a7f60820f6dcc944e0e35c1ab231eb056649 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 23 Feb 2008 09:18:42 +0000 Subject: [PATCH] don't overlook 2nd and later single-letter options in last argument. reported by fedora -REF: <1197916586.13945.120.camel@localhost.localdomain> --- src/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 6fddb1d..1bb0418 100644 --- a/src/main.c +++ b/src/main.c @@ -234,8 +234,10 @@ main( int argc, char **argv ) memset( mvars, 0, sizeof(*mvars) ); mvars->t[1] = 1; - for (mvars->oind = 1, ochar = 0; mvars->oind < argc; ) { + for (mvars->oind = 1, ochar = 0; ; ) { if (!ochar || !*ochar) { + if (mvars->oind >= argc) + break; if (argv[mvars->oind][0] != '-') break; if (argv[mvars->oind][1] == '-') {