From a1c347ecd5b894f323e0b7f7b57d102a5d825c90 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 23 Nov 2010 10:56:50 +0000 Subject: [PATCH] more correctly fix no-option parsing to still parse when no non-arg options are found SVN revision: 54862 --- legacy/ecore/src/lib/ecore/ecore_getopt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/legacy/ecore/src/lib/ecore/ecore_getopt.c b/legacy/ecore/src/lib/ecore/ecore_getopt.c index 741ee95da9..ce38e57ad4 100644 --- a/legacy/ecore/src/lib/ecore/ecore_getopt.c +++ b/legacy/ecore/src/lib/ecore/ecore_getopt.c @@ -1638,7 +1638,6 @@ ecore_getopt_parse(const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int a else prog = parser->prog; - if (argc == 1) return 0; nonargs = _ecore_getopt_parse_find_nonargs_base(parser, argc, argv); if (nonargs < 0) goto error; @@ -1647,7 +1646,7 @@ ecore_getopt_parse(const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int a nonargs = argc; i = 1; - while (i < nonargs) + while ((i < nonargs ? nonargs : argc) && (argv[i])) if (!_ecore_getopt_parse_arg(parser, values, argc, argv, &i, &nonargs)) goto error;