fix bug where getopt_parse returns argc as the first nonopt argument when there are...
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 23 Nov 2010 10:36:15 +0000 (10:36 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 23 Nov 2010 10:36:15 +0000 (10:36 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@54861 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore/ecore_getopt.c

index 993f0eb..741ee95 100644 (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;
 }