]> granicus.if.org Git - re2c/commitdiff
- Fix handling of short opt with parameter if not first opt
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sun, 22 Apr 2007 09:55:53 +0000 (09:55 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sun, 22 Apr 2007 09:55:53 +0000 (09:55 +0000)
re2c/mbo_getopt.cc

index d19fa4e0432d62983ac91eff9a4afc2f91112808..66a42e79a2074863c0482d55dba9e7babd25570c 100755 (executable)
@@ -120,6 +120,7 @@ int mbo_getopt(int argc, char* const *argv, const mbo_opt_struct *opts, char **o
                        (*optind)++;
                        return (mbo_opt_error(argc, argv, *optind - 1, optchr, OPTERRCOLON, show_err));
                }
+               arg_start = 1 + optchr;
        }
 
        if (opts_idx < 0)
@@ -179,7 +180,7 @@ int mbo_getopt(int argc, char* const *argv, const mbo_opt_struct *opts, char **o
        }
        else
        {
-               if (arg_start == 2)
+               if (arg_start >= 2)
                {
                        if (!argv[*optind][optchr + 1])
                        {