fix bug where getopt_parse returns argc as the first nonopt argument when there are no nonopt arguments

SVN revision: 54861
This commit is contained in:
Mike Blumenkrantz 2010-11-23 10:36:15 +00:00
parent 4a3a740a3a
commit c6732ad9cc
1 changed files with 5 additions and 1 deletions

View File

@ -764,7 +764,11 @@ _ecore_getopt_parse_find_nonargs_base(const Ecore_Getopt *parser, int argc, char
dst++;
}
memmove(argv + dst, nonargs, used * sizeof(char *));
if (base != argc)
memmove(argv + dst, nonargs, used * sizeof(char *));
else
/* return 0 since argv[0] is technically the nonargs base */
base = 0;
return base;
}