agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
[PATCH v23 3/8] Row pattern recognition patch (rewriter).
467+ messages / 3 participants
[nested] [flat]

* [PATCH v23 3/8] Row pattern recognition patch (rewriter).
@ 2024-10-25 03:56 Tatsuo Ishii <ishii@postgresql.org>
  0 siblings, 0 replies; 467+ messages in thread

From: Tatsuo Ishii @ 2024-10-25 03:56 UTC (permalink / raw)

---
 src/backend/utils/adt/ruleutils.c | 103 ++++++++++++++++++++++++++++++
 1 file changed, 103 insertions(+)

diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 2177d17e27..c6afcb7747 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -435,6 +435,10 @@ static void get_rule_groupingset(GroupingSet *gset, List *targetlist,
 								 bool omit_parens, deparse_context *context);
 static void get_rule_orderby(List *orderList, List *targetList,
 							 bool force_colno, deparse_context *context);
+static void get_rule_pattern(List *patternVariable, List *patternRegexp,
+							 bool force_colno, deparse_context *context);
+static void get_rule_define(List *defineClause, List *patternVariables,
+							bool force_colno, deparse_context *context);
 static void get_rule_windowclause(Query *query, deparse_context *context);
 static void get_rule_windowspec(WindowClause *wc, List *targetList,
 								deparse_context *context);
@@ -6637,6 +6641,67 @@ get_rule_orderby(List *orderList, List *targetList,
 	}
 }
 
+/*
+ * Display a PATTERN clause.
+ */
+static void
+get_rule_pattern(List *patternVariable, List *patternRegexp,
+				 bool force_colno, deparse_context *context)
+{
+	StringInfo	buf = context->buf;
+	const char *sep;
+	ListCell   *lc_var,
+			   *lc_reg = list_head(patternRegexp);
+
+	sep = "";
+	appendStringInfoChar(buf, '(');
+	foreach(lc_var, patternVariable)
+	{
+		char	   *variable = strVal((String *) lfirst(lc_var));
+		char	   *regexp = NULL;
+
+		if (lc_reg != NULL)
+		{
+			regexp = strVal((String *) lfirst(lc_reg));
+
+			lc_reg = lnext(patternRegexp, lc_reg);
+		}
+
+		appendStringInfo(buf, "%s%s", sep, variable);
+		if (regexp !=NULL)
+			appendStringInfoString(buf, regexp);
+
+		sep = " ";
+	}
+	appendStringInfoChar(buf, ')');
+}
+
+/*
+ * Display a DEFINE clause.
+ */
+static void
+get_rule_define(List *defineClause, List *patternVariables,
+				bool force_colno, deparse_context *context)
+{
+	StringInfo	buf = context->buf;
+	const char *sep;
+	ListCell   *lc_var,
+			   *lc_def;
+
+	sep = "  ";
+	Assert(list_length(patternVariables) == list_length(defineClause));
+
+	forboth(lc_var, patternVariables, lc_def, defineClause)
+	{
+		char	   *varName = strVal(lfirst(lc_var));
+		TargetEntry *te = (TargetEntry *) lfirst(lc_def);
+
+		appendStringInfo(buf, "%s%s AS ", sep, varName);
+		get_rule_expr((Node *) te->expr, context, false);
+		sep = ",\n  ";
+	}
+}
+
 /*
  * Display a WINDOW clause.
  *
@@ -6774,6 +6839,44 @@ get_rule_windowspec(WindowClause *wc, List *targetList,
 			appendStringInfoString(buf, "EXCLUDE GROUP ");
 		else if (wc->frameOptions & FRAMEOPTION_EXCLUDE_TIES)
 			appendStringInfoString(buf, "EXCLUDE TIES ");
+		/* RPR */
+		if (wc->rpSkipTo == ST_NEXT_ROW)
+			appendStringInfoString(buf,
+								   "\n  AFTER MATCH SKIP TO NEXT ROW ");
+		else if (wc->rpSkipTo == ST_PAST_LAST_ROW)
+			appendStringInfoString(buf,
+								   "\n  AFTER MATCH SKIP PAST LAST ROW ");
+		else if (wc->rpSkipTo == ST_FIRST_VARIABLE)
+			appendStringInfo(buf,
+							 "\n  AFTER MATCH SKIP TO FIRST %s ",
+							 wc->rpSkipVariable);
+		else if (wc->rpSkipTo == ST_LAST_VARIABLE)
+			appendStringInfo(buf,
+							 "\n  AFTER MATCH SKIP TO LAST %s ",
+							 wc->rpSkipVariable);
+		else if (wc->rpSkipTo == ST_VARIABLE)
+			appendStringInfo(buf,
+							 "\n  AFTER MATCH SKIP TO %s ",
+							 wc->rpSkipVariable);
+
+		if (wc->initial)
+			appendStringInfoString(buf, "\n  INITIAL");
+
+		if (wc->patternVariable)
+		{
+			appendStringInfoString(buf, "\n  PATTERN ");
+			get_rule_pattern(wc->patternVariable, wc->patternRegexp,
+							 false, context);
+		}
+
+		if (wc->defineClause)
+		{
+			appendStringInfoString(buf, "\n  DEFINE\n");
+			get_rule_define(wc->defineClause, wc->patternVariable,
+							false, context);
+			appendStringInfoChar(buf, ' ');
+		}
+
 		/* we will now have a trailing space; remove it */
 		buf->len--;
 	}
-- 
2.25.1


----Next_Part(Fri_Oct_25_13_04_53_2024_648)--
Content-Type: Text/X-Patch; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="v23-0004-Row-pattern-recognition-patch-planner.patch"



^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)

Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
 src/port/getopt_long.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
 						}
 						else
 						{
+							place = EMSG;
+							optind++;
+
 							if (optstring[0] == ':')
 								return BADARG;
 
@@ -153,9 +156,6 @@ retry:
 										"%s: option requires an argument -- %s\n",
 										argv[0], place);
 
-							place = EMSG;
-							optind++;
-
 							if (has_arg == required_argument)
 								return BADCH;
 							optarg = NULL;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 10:16 Japin Li <japinli@hotmail.com>
  2026-07-22 01:47 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 467+ messages in thread

From: Japin Li @ 2026-07-21 10:16 UTC (permalink / raw)
  To: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>


Hi, hackers

I noticed an inconsistency in how optind is handled when a required argument
is missing.

For short options, the current code handles the BADARG case as follows:

        else if (argc <= ++optind)
        {                       /* no arg */
            place = EMSG;
            if (*optstring == ':')
                return BADARG;
            if (opterr)
                fprintf(stderr,
                        "%s: option requires an argument -- %c\n",
                        argv[0], optopt);
            return BADCH;
        }

Here, place is set to EMSG and optind is incremented before returning BADARG.
However, for long options, the same logic currently sets place = EMSG and
increments optind after returning BADARG.

        else
        {
            if (optstring[0] == ':')
                return BADARG;    <-- here, return before increasing optind

            if (opterr && has_arg == required_argument)
                fprintf(stderr,
                        "%s: option requires an argument -- %s\n",
                        argv[0], place);

            place = EMSG;
            optind++;

            if (has_arg == required_argument)
                return BADCH;
            optarg = NULL;
        }

The attached patch moves the place = EMSG and optind++ assignments to the
beginning of the long‑option error block, aligning the behavior with that of
short options.

Any thought?

-- 
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.



^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* Re: Fix optind handling inconsistency in getopt_long() for missing argument
  2026-07-21 10:16 Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
@ 2026-07-22 01:47 ` Michael Paquier <michael@paquier.xyz>
  2026-07-22 04:17   ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
  0 siblings, 1 reply; 467+ messages in thread

From: Michael Paquier @ 2026-07-22 01:47 UTC (permalink / raw)
  To: Japin Li <japinli@hotmail.com>; +Cc: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>

On Tue, Jul 21, 2026 at 06:16:27PM +0800, Japin Li wrote:
> +  place = EMSG;
> +  optind++;
> +
>    if (optstring[0] == ':')
>        return BADARG;
>  
> @@ -153,9 +156,6 @@ retry:
>                "%s: option requires an argument -- %s\n",
>                argv[0], place);
>  
> -  place = EMSG;
> -  optind++;
> -
>    if (has_arg == required_argument)
>        return BADCH;
>    optarg = NULL;

This also means that for long options we have an error message would
now use an empty string instead of an option name all the time.  That
looks incorrect.

You are claiming that this makes the short option path more
consistent.  That's true based on what your patch does, but it also
looks to me like the short option area is already wrong in setting
EMSG before we issue the error string "option requires an argument".
So, to me, you are making the situation worse in some cases while
claiming that it improves the situation in some other cases.

Our implementation of getopt_long() is only used on Windows for MSVC,
as far as I know.  I'd also suggest to post one or more examples of
how this changes the implementation behavior.  You should be able to
force your way through easily so as the Postgres getopt_long()
implementation is used with a quick hack, just to prove your point,
saving you the pain of deploying a WIN32 host..  (Like use a
pg_getopt_long() and patch one of the binaries, whatever you prefer.)
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../../amAhNvNM4I4ATevL@paquier.xyz/2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* Re: Fix optind handling inconsistency in getopt_long() for missing argument
  2026-07-21 10:16 Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
  2026-07-22 01:47 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
@ 2026-07-22 04:17   ` Japin Li <japinli@hotmail.com>
  2026-07-22 04:22     ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
  0 siblings, 1 reply; 467+ messages in thread

From: Japin Li @ 2026-07-22 04:17 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>

Hi, Michael

Thanks for reviewing the patch.

<#secure method=pgpmime mode=sign>
On Wed, 22 Jul 2026 at 10:47, Michael Paquier <michael@paquier.xyz> wrote:
> On Tue, Jul 21, 2026 at 06:16:27PM +0800, Japin Li wrote:
>> +  place = EMSG;
>> +  optind++;
>> +
>>    if (optstring[0] == ':')
>>        return BADARG;
>>  
>> @@ -153,9 +156,6 @@ retry:
>>                "%s: option requires an argument -- %s\n",
>>                argv[0], place);
>>  
>> -  place = EMSG;
>> -  optind++;
>> -
>>    if (has_arg == required_argument)
>>        return BADCH;
>>    optarg = NULL;
>
> This also means that for long options we have an error message would
> now use an empty string instead of an option name all the time.  That
> looks incorrect.

Right.  I was mistaken about the option name.  Fixed in v2-0002.

>
> You are claiming that this makes the short option path more
> consistent.  That's true based on what your patch does, but it also
> looks to me like the short option area is already wrong in setting
> EMSG before we issue the error string "option requires an argument".
> So, to me, you are making the situation worse in some cases while
> claiming that it improves the situation in some other cases.
>
> Our implementation of getopt_long() is only used on Windows for MSVC,
> as far as I know.  I'd also suggest to post one or more examples of
> how this changes the implementation behavior.  You should be able to
> force your way through easily so as the Postgres getopt_long()
> implementation is used with a quick hack, just to prove your point,
> saving you the pain of deploying a WIN32 host..  (Like use a
> pg_getopt_long() and patch one of the binaries, whatever you prefer.)

Here's a mini‑demo for getopt_long() in v2‑0001. Without v2‑0002, the output is:

    $ ./getopt_long_test --log-filename
    option './getopt_long_test' requires an argument
    unrecognized option './getopt_long_test'
    unrecognized option './getopt_long_test'
    unrecognized option './getopt_long_test'
    unrecognized option './getopt_long_test'
    $ ./getopt_long_test -f
    option '-f' requires an argument

With v2‑0002 applied, the output is:

    $ ./getopt_long_test --log-filename
    option '--log-filename' requires an argument
    $ ./getopt_long_test -f
    option '-f' requires an argument

> --
> Michael

-- 
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* Re: Fix optind handling inconsistency in getopt_long() for missing argument
  2026-07-21 10:16 Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
  2026-07-22 01:47 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
  2026-07-22 04:17   ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
@ 2026-07-22 04:22     ` Japin Li <japinli@hotmail.com>
  2026-07-31 03:48       ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 467+ messages in thread

From: Japin Li @ 2026-07-22 04:22 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>

On Wed, 22 Jul 2026 at 12:17, Japin Li <japinli@hotmail.com> wrote:
> Hi, Michael
>
> Thanks for reviewing the patch.
>
> <#secure method=pgpmime mode=sign>
> On Wed, 22 Jul 2026 at 10:47, Michael Paquier <michael@paquier.xyz> wrote:
>> On Tue, Jul 21, 2026 at 06:16:27PM +0800, Japin Li wrote:
>>> +  place = EMSG;
>>> +  optind++;
>>> +
>>>    if (optstring[0] == ':')
>>>        return BADARG;
>>>  
>>> @@ -153,9 +156,6 @@ retry:
>>>                "%s: option requires an argument -- %s\n",
>>>                argv[0], place);
>>>  
>>> -  place = EMSG;
>>> -  optind++;
>>> -
>>>    if (has_arg == required_argument)
>>>        return BADCH;
>>>    optarg = NULL;
>>
>> This also means that for long options we have an error message would
>> now use an empty string instead of an option name all the time.  That
>> looks incorrect.
>
> Right.  I was mistaken about the option name.  Fixed in v2-0002.
>
>>
>> You are claiming that this makes the short option path more
>> consistent.  That's true based on what your patch does, but it also
>> looks to me like the short option area is already wrong in setting
>> EMSG before we issue the error string "option requires an argument".
>> So, to me, you are making the situation worse in some cases while
>> claiming that it improves the situation in some other cases.
>>
>> Our implementation of getopt_long() is only used on Windows for MSVC,
>> as far as I know.  I'd also suggest to post one or more examples of
>> how this changes the implementation behavior.  You should be able to
>> force your way through easily so as the Postgres getopt_long()
>> implementation is used with a quick hack, just to prove your point,
>> saving you the pain of deploying a WIN32 host..  (Like use a
>> pg_getopt_long() and patch one of the binaries, whatever you prefer.)
>
> Here's a mini‑demo for getopt_long() in v2‑0001. Without v2‑0002, the output is:
>
>     $ ./getopt_long_test --log-filename
>     option './getopt_long_test' requires an argument
>     unrecognized option './getopt_long_test'
>     unrecognized option './getopt_long_test'
>     unrecognized option './getopt_long_test'
>     unrecognized option './getopt_long_test'
>     $ ./getopt_long_test -f
>     option '-f' requires an argument
>
> With v2‑0002 applied, the output is:
>
>     $ ./getopt_long_test --log-filename
>     option '--log-filename' requires an argument
>     $ ./getopt_long_test -f
>     option '-f' requires an argument
>
>> --
>> Michael
>

Sorry, I forgot to include the patches in my previous email.

> -- 
> Regards,
> Japin Li
> ChengDu WenWu Information Technology Co., Ltd.

-- 
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.



^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* Re: Fix optind handling inconsistency in getopt_long() for missing argument
  2026-07-21 10:16 Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
  2026-07-22 01:47 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
  2026-07-22 04:17   ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
  2026-07-22 04:22     ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
@ 2026-07-31 03:48       ` Michael Paquier <michael@paquier.xyz>
  2026-07-31 05:27         ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
  0 siblings, 1 reply; 467+ messages in thread

From: Michael Paquier @ 2026-07-31 03:48 UTC (permalink / raw)
  To: Japin Li <japinli@hotmail.com>; +Cc: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>

On Wed, Jul 22, 2026 at 12:22:06PM +0800, Japin Li wrote:
> On Wed, 22 Jul 2026 at 12:17, Japin Li <japinli@hotmail.com> wrote:
>> With v2‑0002 applied, the output is:
>>
>>     $ ./getopt_long_test --log-filename
>>     option '--log-filename' requires an argument
>>     $ ./getopt_long_test -f
>>     option '-f' requires an argument

Thanks, that saves time.  I have been also checking how libc behaves,
debugging more information with optind, argv, optarg, opterr and
optopt with the short and long cases.

One side note: optopt still remains inconsistent compared to our port
version.  Not sure if this is worth caring about..  Mentioning
in passing.

> Sorry, I forgot to include the patches in my previous email.

No problem.  That happens.

Adjusted on HEAD.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../../amwa9nvUdE5QneAD@paquier.xyz/2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* Re: Fix optind handling inconsistency in getopt_long() for missing argument
  2026-07-21 10:16 Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
  2026-07-22 01:47 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
  2026-07-22 04:17   ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
  2026-07-22 04:22     ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
  2026-07-31 03:48       ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
@ 2026-07-31 05:27         ` Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-31 05:27 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>

References: <SY7PR01MB10921AF81F18A8BCFA06388BEB6C22@SY7PR01MB10921.ausprd01.prod.outlook.com>
	<amAhNvNM4I4ATevL@paquier.xyz>
	<SY7PR01MB10921B103CBDC8A0128D156B5B6C12@SY7PR01MB10921.ausprd01.prod.outlook.com>
	<SY7PR01MB109210E2A46D09049F98D185AB6C12@SY7PR01MB10921.ausprd01.prod.outlook.com>
	<amwa9nvUdE5QneAD@paquier.xyz>
User-Agent: mu4e 1.14.1; emacs 30.2
Date: Fri, 31 Jul 2026 13:27:31 +0800

<#secure method=pgpmime mode=sign>
On Fri, 31 Jul 2026 at 12:48, Michael Paquier <michael@paquier.xyz> wrote:
> On Wed, Jul 22, 2026 at 12:22:06PM +0800, Japin Li wrote:
>> On Wed, 22 Jul 2026 at 12:17, Japin Li <japinli@hotmail.com> wrote:
>>> With v2‑0002 applied, the output is:
>>>
>>>     $ ./getopt_long_test --log-filename
>>>     option '--log-filename' requires an argument
>>>     $ ./getopt_long_test -f
>>>     option '-f' requires an argument
>
> Thanks, that saves time.  I have been also checking how libc behaves,
> debugging more information with optind, argv, optarg, opterr and
> optopt with the short and long cases.
>
> One side note: optopt still remains inconsistent compared to our port
> version.  Not sure if this is worth caring about..  Mentioning
> in passing.
>
>> Sorry, I forgot to include the patches in my previous email.
>
> No problem.  That happens.
>
> Adjusted on HEAD.

Thank you!

> --
> Michael

-- 
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread

* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 467+ messages in thread

From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)

In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG.  This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
 src/port/getopt_long.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
 						}
 						else
 						{
+							optind++;
 							if (optstring[0] == ':')
+							{
+								place = EMSG;
 								return BADARG;
+							}
 
 							if (opterr && has_arg == required_argument)
 								fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
 										argv[0], place);
 
 							place = EMSG;
-							optind++;
 
 							if (has_arg == required_argument)
 								return BADCH;
-- 
2.53.0


--=-=-=--






^ permalink  raw  reply  [nested|flat] 467+ messages in thread


end of thread, other threads:[~2026-07-31 05:27 UTC | newest]

Thread overview: 467+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-10-25 03:56 [PATCH v23 3/8] Row pattern recognition patch (rewriter). Tatsuo Ishii <ishii@postgresql.org>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 10:16 Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 01:47 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
2026-07-22 04:17   ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 04:22     ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-31 03:48       ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
2026-07-31 05:27         ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 03:59 [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox