changeset 2650:bf7248edcc20

fixed commandline bug: handling '-' as option when '--' unused
author alex
date Sat, 03 Nov 2001 19:04:58 +0000
parents d05fc32b7984
children 958d10763c34
files cfgparser.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/cfgparser.c	Sat Nov 03 18:45:13 2001 +0000
+++ b/cfgparser.c	Sat Nov 03 19:04:58 2001 +0000
@@ -522,7 +522,7 @@
 	for (i = 1; i < argc; i++) {
 next:
 		opt = argv[i];
-		/* check for -- (no more options id.) except --help ! */
+		/* check for -- (no more options id.) except --help! */
 		if ((*opt == '-') && (*(opt+1) == '-') && (*(opt+2) != 'h'))
 		{
 			no_more_opts = 1;
@@ -535,7 +535,7 @@
 			goto next;
 		}
 			
-		if ((no_more_opts == 0) && (*opt == '-')) /* option */
+		if ((no_more_opts == 0) && (*opt == '-') && (*(opt+1) != 0)) /* option */
 		{
 		    /* remove trailing '-' */
 		    opt++;