From 8d87838d1a0b5b014524233ef7c931238091981e Mon Sep 17 00:00:00 2001 From: helly Date: Wed, 21 Mar 2007 22:15:16 +0000 Subject: [PATCH] - Fix issue with long form of switches --- re2c/mbo_getopt.cc | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/re2c/mbo_getopt.cc b/re2c/mbo_getopt.cc index 81557daa..f284d6e8 100755 --- a/re2c/mbo_getopt.cc +++ b/re2c/mbo_getopt.cc @@ -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) -- 2.50.1