Ops, you've screwed it all!

Non-opt does not include argv[0], if no opts the correct return is argc!

The logic to users should be:

If < 0: error
Else if  == argc: no non-opt args
Else: non-opt args from it to argc

On Tuesday, November 23, 2010, Enlightenment SVN
<no-re...@enlightenment.org> wrote:
> Log:
>   I'm tired of you, ecore_getopt. now you get the hammer.
>
> Author:       discomfitor
> Date:         2010-11-23 03:10:41 -0800 (Tue, 23 Nov 2010)
> New Revision: 54863
>
> Modified:
>   trunk/ecore/src/lib/ecore/ecore_getopt.c
>
> Modified: trunk/ecore/src/lib/ecore/ecore_getopt.c
> ===================================================================
> --- trunk/ecore/src/lib/ecore/ecore_getopt.c    2010-11-23 10:56:50 UTC (rev 
> 54862)
> +++ trunk/ecore/src/lib/ecore/ecore_getopt.c    2010-11-23 11:10:41 UTC (rev 
> 54863)
> @@ -1646,10 +1646,21 @@
>       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;
>
>   error:
>
>
> ------------------------------------------------------------------------------
> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
> Tap into the largest installed PC base & get more eyes on your game by
> optimizing for Intel(R) Graphics Technology. Get started today with the
> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
> http://p.sf.net/sfu/intelisp-dev2dev
> _______________________________________________
> enlightenment-svn mailing list
> enlightenment-...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to