agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feed[PATCH 3/6] Move conversion of a "historic" to MVCC snapshot to a separate function.
467+ messages / 3 participants
[nested] [flat]
* [PATCH 3/6] Move conversion of a "historic" to MVCC snapshot to a separate function.
@ 2026-01-27 10:48 Antonin Houska <ah@cybertec.at>
0 siblings, 0 replies; 467+ messages in thread
From: Antonin Houska @ 2026-01-27 10:48 UTC (permalink / raw)
The conversion is now handled by SnapBuildMVCCFromHistoric(). REPACK
CONCURRENTLY will also need it.
---
src/backend/replication/logical/snapbuild.c | 59 +++++++++++++++++----
src/backend/utils/time/snapmgr.c | 3 +-
src/include/replication/snapbuild.h | 1 +
src/include/utils/snapmgr.h | 1 +
4 files changed, 52 insertions(+), 12 deletions(-)
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index 7f79621b57e..a738ad8a864 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -440,10 +440,7 @@ Snapshot
SnapBuildInitialSnapshot(SnapBuild *builder)
{
Snapshot snap;
- TransactionId xid;
TransactionId safeXid;
- TransactionId *newxip;
- int newxcnt = 0;
Assert(XactIsoLevel == XACT_REPEATABLE_READ);
Assert(builder->building_full_snapshot);
@@ -485,7 +482,35 @@ SnapBuildInitialSnapshot(SnapBuild *builder)
MyProc->xmin = snap->xmin;
- /* allocate in transaction context */
+ /* Convert the historic snapshot to MVCC snapshot. */
+ return SnapBuildMVCCFromHistoric(snap, true);
+}
+
+/*
+ * Turn a historic MVCC snapshot into an ordinary MVCC snapshot.
+ *
+ * Unlike a regular (non-historic) MVCC snapshot, the 'xip' array of this
+ * snapshot contains not only running main transactions, but also their
+ * subtransactions. On the other hand, 'subxip' will usually be empty. This
+ * difference does not affect the result of XidInMVCCSnapshot() because it
+ * searches both in 'xip' and 'subxip'.
+ *
+ * Pass true for 'in_place' if you don't care about modifying the source
+ * snapshot. If you need a new instance, and one that was allocated as a
+ * single chunk of memory, pass false.
+ */
+Snapshot
+SnapBuildMVCCFromHistoric(Snapshot snapshot, bool in_place)
+{
+ TransactionId xid;
+ TransactionId *oldxip = snapshot->xip;
+ uint32 oldxcnt = snapshot->xcnt;
+ TransactionId *newxip;
+ int newxcnt = 0;
+ Snapshot result;
+
+ Assert(snapshot->snapshot_type == SNAPSHOT_HISTORIC_MVCC);
+
newxip = palloc_array(TransactionId, GetMaxSnapshotXidCount());
/*
@@ -494,7 +519,7 @@ SnapBuildInitialSnapshot(SnapBuild *builder)
* classical snapshot by marking all non-committed transactions as
* in-progress. This can be expensive.
*/
- for (xid = snap->xmin; NormalTransactionIdPrecedes(xid, snap->xmax);)
+ for (xid = snapshot->xmin; NormalTransactionIdPrecedes(xid, snapshot->xmax);)
{
void *test;
@@ -502,7 +527,7 @@ SnapBuildInitialSnapshot(SnapBuild *builder)
* Check whether transaction committed using the decoding snapshot
* meaning of ->xip.
*/
- test = bsearch(&xid, snap->xip, snap->xcnt,
+ test = bsearch(&xid, snapshot->xip, snapshot->xcnt,
sizeof(TransactionId), xidComparator);
if (test == NULL)
@@ -519,11 +544,25 @@ SnapBuildInitialSnapshot(SnapBuild *builder)
}
/* adjust remaining snapshot fields as needed */
- snap->snapshot_type = SNAPSHOT_MVCC;
- snap->xcnt = newxcnt;
- snap->xip = newxip;
+ snapshot->xcnt = newxcnt;
+ snapshot->xip = newxip;
+
+ if (in_place)
+ result = snapshot;
+ else
+ {
+ result = CopySnapshot(snapshot);
+
+ /* Restore the original values so the source is intact. */
+ snapshot->xip = oldxip;
+ snapshot->xcnt = oldxcnt;
+
+ /* newxip has been copied */
+ pfree(newxip);
+ }
+ result->snapshot_type = SNAPSHOT_MVCC;
- return snap;
+ return result;
}
/*
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 2e6197f5f35..3af1b366adf 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -213,7 +213,6 @@ typedef struct ExportedSnapshot
static List *exportedSnapshots = NIL;
/* Prototypes for local functions */
-static Snapshot CopySnapshot(Snapshot snapshot);
static void UnregisterSnapshotNoOwner(Snapshot snapshot);
static void FreeSnapshot(Snapshot snapshot);
static void SnapshotResetXmin(void);
@@ -604,7 +603,7 @@ SetTransactionSnapshot(Snapshot sourcesnap, VirtualTransactionId *sourcevxid,
* The copy is palloc'd in TopTransactionContext and has initial refcounts set
* to 0. The returned snapshot has the copied flag set.
*/
-static Snapshot
+Snapshot
CopySnapshot(Snapshot snapshot)
{
Snapshot newsnap;
diff --git a/src/include/replication/snapbuild.h b/src/include/replication/snapbuild.h
index ccded021433..34383dea776 100644
--- a/src/include/replication/snapbuild.h
+++ b/src/include/replication/snapbuild.h
@@ -73,6 +73,7 @@ extern void FreeSnapshotBuilder(SnapBuild *builder);
extern void SnapBuildSnapDecRefcount(Snapshot snap);
extern Snapshot SnapBuildInitialSnapshot(SnapBuild *builder);
+extern Snapshot SnapBuildMVCCFromHistoric(Snapshot snapshot, bool in_place);
extern const char *SnapBuildExportSnapshot(SnapBuild *builder);
extern void SnapBuildClearExportedSnapshot(void);
extern void SnapBuildResetExportedSnapshotState(void);
diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h
index b8c01a291a1..de824945f0b 100644
--- a/src/include/utils/snapmgr.h
+++ b/src/include/utils/snapmgr.h
@@ -63,6 +63,7 @@ extern Snapshot GetTransactionSnapshot(void);
extern Snapshot GetLatestSnapshot(void);
extern void SnapshotSetCommandId(CommandId curcid);
+extern Snapshot CopySnapshot(Snapshot snapshot);
extern Snapshot GetCatalogSnapshot(Oid relid);
extern Snapshot GetNonHistoricCatalogSnapshot(Oid relid);
extern void InvalidateCatalogSnapshot(void);
--
2.47.3
--=-=-=
Content-Type: text/plain
Content-Disposition: attachment;
filename=v32-0004-Add-CONCURRENTLY-option-to-REPACK-command.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>
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-22 01:47 Michael Paquier <michael@paquier.xyz>
parent: 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
* [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
* Re: Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 04:17 Japin Li <japinli@hotmail.com>
parent: Michael Paquier <michael@paquier.xyz>
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-22 04:22 Japin Li <japinli@hotmail.com>
parent: Japin Li <japinli@hotmail.com>
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-31 03:48 Michael Paquier <michael@paquier.xyz>
parent: 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-31 05:27 Japin Li <japinli@hotmail.com>
parent: Michael Paquier <michael@paquier.xyz>
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
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 --
2026-01-27 10:48 [PATCH 3/6] Move conversion of a "historic" to MVCC snapshot to a separate function. Antonin Houska <ah@cybertec.at>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-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