From 936758007ba60c1d47fdef634f4e79e1e1d25720 Mon Sep 17 00:00:00 2001 From: discomfitor Date: Tue, 23 Nov 2010 11:10:41 +0000 Subject: [PATCH] I'm tired of you, ecore_getopt. now you get the hammer. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@54863 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore/ecore_getopt.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore/ecore_getopt.c b/src/lib/ecore/ecore_getopt.c index ce38e57..6dc2a27 100644 --- a/src/lib/ecore/ecore_getopt.c +++ b/src/lib/ecore/ecore_getopt.c @@ -1646,9 +1646,20 @@ ecore_getopt_parse(const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int a nonargs = argc; i = 1; - while ((i < nonargs ? nonargs : argc) && (argv[i])) - if (!_ecore_getopt_parse_arg(parser, values, argc, argv, &i, &nonargs)) - goto error; + if (nonargs) + { + while (i < nonargs) + if (!_ecore_getopt_parse_arg(parser, values, argc, argv, &i, &nonargs)) + goto error; + } + else + { + int tmp = 0; + + while (i < argc) + if (!_ecore_getopt_parse_arg(parser, values, argc, argv, &i, &tmp)) + goto error; + } return nonargs; -- 2.7.4