From 2383ef8254ea9845345b45bac069e897b07eb401 Mon Sep 17 00:00:00 2001 From: helly Date: Sun, 22 Apr 2007 09:55:53 +0000 Subject: [PATCH] - Fix handling of short opt with parameter if not first opt --- re2c/mbo_getopt.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/re2c/mbo_getopt.cc b/re2c/mbo_getopt.cc index d19fa4e0..66a42e79 100755 --- a/re2c/mbo_getopt.cc +++ b/re2c/mbo_getopt.cc @@ -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]) { -- 2.50.1