]> granicus.if.org Git - re2c/commitdiff
- Fix issue with long form of switches
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Wed, 21 Mar 2007 22:15:16 +0000 (22:15 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Wed, 21 Mar 2007 22:15:16 +0000 (22:15 +0000)
re2c/mbo_getopt.cc

index 81557daa6858eee045056dfaf20ac5625542f95a..f284d6e88a3027c05f6fe715b5517cc307a33de9 100755 (executable)
@@ -98,22 +98,24 @@ int mbo_getopt(int argc, char* const *argv, const mbo_opt_struct *opts, char **o
                }
 
                optchr = 0;
-               dash = 1;
+               dash = 0;
                arg_start = 2 + strlen(opts[opts_idx].opt_name);
        }
-
-       if (!dash)
+       else
        {
-               dash = 1;
-               optchr = 1;
-       }
+               if (!dash)
+               {
+                       dash = 1;
+                       optchr = 1;
+               }
 
-       /* Check if the guy tries to do a -: kind of flag */
-       if (argv[*optind][optchr] == ':')
-       {
-               dash = 0;
-               (*optind)++;
-               return (mbo_opt_error(argc, argv, *optind - 1, optchr, OPTERRCOLON, show_err));
+               /* Check if the guy tries to do a -: kind of flag */
+               if (argv[*optind][optchr] == ':')
+               {
+                       dash = 0;
+                       (*optind)++;
+                       return (mbo_opt_error(argc, argv, *optind - 1, optchr, OPTERRCOLON, show_err));
+               }
        }
 
        if (opts_idx < 0)