agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feed[PATCH v9a 16/22] ci: Formatting, Naming and consistency improvements
467+ messages / 3 participants
[nested] [flat]
* [PATCH v9a 16/22] ci: Formatting, Naming and consistency improvements
@ 2026-06-03 17:15 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 467+ messages in thread
From: Andres Freund @ 2026-06-03 17:15 UTC (permalink / raw)
---
.github/workflows/pg-ci.yml | 76 ++++++++++++++++++-------------------
1 file changed, 36 insertions(+), 40 deletions(-)
diff --git a/.github/workflows/pg-ci.yml b/.github/workflows/pg-ci.yml
index 72d306feb14..a570b9e2c8d 100644
--- a/.github/workflows/pg-ci.yml
+++ b/.github/workflows/pg-ci.yml
@@ -126,7 +126,10 @@ env:
jobs:
- # Parse "ci-os-only: ..." from the commit message and expose flags
+
+ # Job: Determine enabled jobs
+ #
+ # Parses "ci-os-only: ..." from the commit message and exposes flags
# consumed by the jobs' `if:` conditions.
setup:
name: Determine enabled jobs
@@ -144,6 +147,7 @@ jobs:
# context is not available.
container_linux_ci: ${{ env.CONTAINER_REPO }}/${{ env.CONTAINER_LINUX_CI }}
container_linux_ci_docs: ${{ env.CONTAINER_REPO }}/${{ env.CONTAINER_LINUX_CI_DOCS }}
+
steps:
# Anchor reused by other jobs further down. GitHub Actions supports YAML
# anchors/aliases but not merge keys, so the alias copies the whole step
@@ -180,6 +184,8 @@ jobs:
cat "$GITHUB_OUTPUT"
+ # Job: SanityCheck
+ #
# To avoid unnecessarily spinning up a lot of VMs / containers for entirely
# broken commits, have a minimal task that all others depend on.
#
@@ -219,6 +225,7 @@ jobs:
env:
# no options enabled, should be small
CCACHE_MAXSIZE: "150M"
+
steps:
- *nix_sysinfo_step
@@ -238,7 +245,7 @@ jobs:
ccache-${{ github.job }}-${{ github.ref_name }}-
ccache-${{ github.job }}-
- - &linux_prepare_workspace
+ - &linux_prepare_workspace_step
name: Prepare workspace
run: |
useradd -m postgres
@@ -271,7 +278,7 @@ jobs:
- name: Build
shell: *su_postgres_shell
- run: &ninja_build_command |
+ run: &ninja_build_cmd |
ninja -C build -j${{env.BUILD_JOBS}} ${{env.MBUILD_TARGET}}
ninja -C build -t missingdeps
@@ -312,7 +319,7 @@ jobs:
meson test ${{env.MTEST_ARGS}} --num-processes ${{env.TEST_JOBS}} ${{env.MTEST_TARGET}}
- - &linux_collect_cores
+ - &linux_collect_cores_step
name: Core backtraces
if: failure() && !cancelled()
run: src/tools/ci/cores_backtrace.sh linux /tmp/cores
@@ -333,7 +340,7 @@ jobs:
if-no-files-found: ignore
- # Linux, Autoconf
+ # Job: Linux - Autoconf
#
# SPECIAL:
# - Uses undefined & alignment sanitizers (sanitizer failures are typically
@@ -398,7 +405,7 @@ jobs:
- *nix_sysinfo_step
- *checkout_step
- *ccache_restore_step
- - *linux_prepare_workspace
+ - *linux_prepare_workspace_step
- name: Configure
shell: *su_postgres_shell
@@ -423,11 +430,11 @@ jobs:
run: |
make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS}
- - *linux_collect_cores
+ - *linux_collect_cores_step
- *upload_logs_step
- # Linux Meson, 32 bit
+ # Job: Linux - Meson (32-bit)
#
# SPECIAL:
# - Uses undefined behaviour and alignment sanitizers, (sanitizer failures
@@ -458,7 +465,7 @@ jobs:
- *nix_sysinfo_step
- *checkout_step
- *ccache_restore_step
- - *linux_prepare_workspace
+ - *linux_prepare_workspace_step
- name: Configure
shell: *su_postgres_shell
@@ -474,7 +481,7 @@ jobs:
- name: Build
shell: *su_postgres_shell
- run: *ninja_build_command
+ run: *ninja_build_cmd
- *ccache_save_step
@@ -515,11 +522,11 @@ jobs:
build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop
- - *linux_collect_cores
+ - *linux_collect_cores_step
- *upload_logs_step
- # Linux Meson, 64 bit
+ # Linux - Meson (64-bit)
#
# SPECIAL:
# - Uses address sanitizer, (sanitizer failures are typically printed in the
@@ -546,7 +553,7 @@ jobs:
- *nix_sysinfo_step
- *checkout_step
- *ccache_restore_step
- - *linux_prepare_workspace
+ - *linux_prepare_workspace_step
- name: Configure
shell: *su_postgres_shell
@@ -560,7 +567,7 @@ jobs:
- name: Build
shell: *su_postgres_shell
- run: *ninja_build_command
+ run: *ninja_build_cmd
- *ccache_save_step
@@ -568,10 +575,12 @@ jobs:
shell: *su_postgres_shell
run: *meson_test_world_cmd
- - *linux_collect_cores
+ - *linux_collect_cores_step
- *upload_logs_step
+ # Job: macOS - Meson
+ #
# SPECIAL:
# - Enables --clone for pg_upgrade and pg_combinebackup
# - Specifies configuration options that test reading/writing/copying of node trees
@@ -628,8 +637,8 @@ jobs:
steps:
- *nix_sysinfo_step
-
- *checkout_step
+ - *ccache_restore_step
- name: Setup core files
run: |
@@ -674,8 +683,6 @@ jobs:
echo /opt/local/sbin >> "$GITHUB_PATH"
echo /opt/local/bin >> "$GITHUB_PATH"
- - *ccache_restore_step
-
- name: Configure
env:
PKG_CONFIG_PATH: /opt/local/lib/pkgconfig/
@@ -691,7 +698,7 @@ jobs:
build
- name: Build
- run: *ninja_build_command
+ run: *ninja_build_cmd
- *ccache_save_step
@@ -708,6 +715,7 @@ jobs:
- *upload_logs_step
+ # Job: Windows - Visual Studio
windows-vs:
name: Windows - Visual Studio
needs: [setup, sanity-check]
@@ -735,8 +743,9 @@ jobs:
defaults:
run:
shell: cmd
+
steps:
- - &windows_disable_defender
+ - &windows_disable_defender_step
name: Disable Windows Defender
shell: powershell
run: |
@@ -821,7 +830,6 @@ jobs:
if (!$?) { throw 'cmdfail' }
echo ::endgroup::
-
# Install IPC::Run.
# - recommends_policy=0 keeps cpan from pulling in IO::Tty / IO::Pty,
# which don't build on Windows ("This module requires a POSIX
@@ -879,6 +887,7 @@ jobs:
- *upload_logs_step
+ # Job: Windows - MinGW - Meson
windows-mingw:
name: Windows - MinGW - Meson
needs: [setup, sanity-check]
@@ -912,7 +921,7 @@ jobs:
shell: 'D:\msys64\usr\bin\bash.exe --login -eo pipefail "{0}"'
steps:
- - *windows_disable_defender
+ - *windows_disable_defender_step
- *checkout_step
# Relocate the preinstalled MSYS2 tree from C:\ (slow system disk) to
@@ -981,7 +990,7 @@ jobs:
build
- name: Build
- run: *ninja_build_command
+ run: *ninja_build_cmd
- *ccache_save_step
@@ -993,6 +1002,8 @@ jobs:
- *upload_logs_step
+ # Job: CompilerWarnings
+ #
# Test that code can be built with both gcc and clang without warnings,
# with various combinations of cassert/dtrace flags. Trace probes have
# a history of getting accidentally broken; the matrix is there to
@@ -1017,20 +1028,10 @@ jobs:
# compilers / flag combinations.
CCACHE_MAXSIZE: "1G"
DEFAULT_BUILD: world-bin
+
steps:
-
- - name: Sysinfo
- run: |
- id
- uname -a
- cat /proc/cmdline
- ulimit -a -H && ulimit -a -S
- gcc -v
- clang -v
- env
-
+ - *nix_sysinfo_step
- *checkout_step
-
- *ccache_restore_step
- name: Setup workspace
@@ -1055,7 +1056,6 @@ jobs:
make -s -j${{env.BUILD_JOBS}} clean
make -s -j${{env.BUILD_JOBS}} ${{env.DEFAULT_BUILD}}
-
# gcc, cassert on, dtrace off
- name: gcc warnings + (cassert)
if: ${{ !cancelled() }}
@@ -1065,7 +1065,6 @@ jobs:
CXX: ccache g++
run: *compiler_warnings_cmd
-
# clang, cassert off, dtrace off
- name: clang warnings
if: ${{ !cancelled() }}
@@ -1075,7 +1074,6 @@ jobs:
CXX: ccache clang++
run: *compiler_warnings_cmd
-
# clang, cassert on, dtrace on
- name: clang warnings + (cassert + dtrace)
if: ${{ !cancelled() }}
@@ -1085,7 +1083,6 @@ jobs:
CXX: ccache clang++
run: *compiler_warnings_cmd
-
- name: mingw warnings (cross compilation)
if: ${{ !cancelled() }}
env:
@@ -1094,7 +1091,6 @@ jobs:
CXX: ccache x86_64-w64-mingw32ucrt-g++
run: *compiler_warnings_cmd
-
###
# Verify docs can be built
###
--
2.54.0.380.gc69baaf57b
--lyfxwjjve3vodszg
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9a-0017-ci-Don-t-run-setup-twice.patch"
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 09:49 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-21 09:49 UTC (permalink / raw)
Move optind++ and place = EMSG before the BADARG return in the long option
path to match short option behavior and ensure consistent state.
---
src/port/getopt_long.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..a488a647889 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,6 +145,9 @@ retry:
}
else
{
+ place = EMSG;
+ optind++;
+
if (optstring[0] == ':')
return BADARG;
@@ -153,9 +156,6 @@ retry:
"%s: option requires an argument -- %s\n",
argv[0], place);
- place = EMSG;
- optind++;
-
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-21 10:16 Japin Li <japinli@hotmail.com>
2026-07-22 01:47 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
0 siblings, 1 reply; 467+ messages in thread
From: Japin Li @ 2026-07-21 10:16 UTC (permalink / raw)
To: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>
Hi, hackers
I noticed an inconsistency in how optind is handled when a required argument
is missing.
For short options, the current code handles the BADARG case as follows:
else if (argc <= ++optind)
{ /* no arg */
place = EMSG;
if (*optstring == ':')
return BADARG;
if (opterr)
fprintf(stderr,
"%s: option requires an argument -- %c\n",
argv[0], optopt);
return BADCH;
}
Here, place is set to EMSG and optind is incremented before returning BADARG.
However, for long options, the same logic currently sets place = EMSG and
increments optind after returning BADARG.
else
{
if (optstring[0] == ':')
return BADARG; <-- here, return before increasing optind
if (opterr && has_arg == required_argument)
fprintf(stderr,
"%s: option requires an argument -- %s\n",
argv[0], place);
place = EMSG;
optind++;
if (has_arg == required_argument)
return BADCH;
optarg = NULL;
}
The attached patch moves the place = EMSG and optind++ assignments to the
beginning of the long‑option error block, aligning the behavior with that of
short options.
Any thought?
--
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.
^ permalink raw reply [nested|flat] 467+ messages in thread
* Re: Fix optind handling inconsistency in getopt_long() for missing argument
2026-07-21 10:16 Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
@ 2026-07-22 01:47 ` Michael Paquier <michael@paquier.xyz>
2026-07-22 04:17 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
0 siblings, 1 reply; 467+ messages in thread
From: Michael Paquier @ 2026-07-22 01:47 UTC (permalink / raw)
To: Japin Li <japinli@hotmail.com>; +Cc: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>
On Tue, Jul 21, 2026 at 06:16:27PM +0800, Japin Li wrote:
> + place = EMSG;
> + optind++;
> +
> if (optstring[0] == ':')
> return BADARG;
>
> @@ -153,9 +156,6 @@ retry:
> "%s: option requires an argument -- %s\n",
> argv[0], place);
>
> - place = EMSG;
> - optind++;
> -
> if (has_arg == required_argument)
> return BADCH;
> optarg = NULL;
This also means that for long options we have an error message would
now use an empty string instead of an option name all the time. That
looks incorrect.
You are claiming that this makes the short option path more
consistent. That's true based on what your patch does, but it also
looks to me like the short option area is already wrong in setting
EMSG before we issue the error string "option requires an argument".
So, to me, you are making the situation worse in some cases while
claiming that it improves the situation in some other cases.
Our implementation of getopt_long() is only used on Windows for MSVC,
as far as I know. I'd also suggest to post one or more examples of
how this changes the implementation behavior. You should be able to
force your way through easily so as the Postgres getopt_long()
implementation is used with a quick hack, just to prove your point,
saving you the pain of deploying a WIN32 host.. (Like use a
pg_getopt_long() and patch one of the binaries, whatever you prefer.)
--
Michael
Attachments:
[application/pgp-signature] signature.asc (833B, ../../amAhNvNM4I4ATevL@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 467+ messages in thread
* Re: Fix optind handling inconsistency in getopt_long() for missing argument
2026-07-21 10:16 Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 01:47 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
@ 2026-07-22 04:17 ` Japin Li <japinli@hotmail.com>
2026-07-22 04:22 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
0 siblings, 1 reply; 467+ messages in thread
From: Japin Li @ 2026-07-22 04:17 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; +Cc: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>
Hi, Michael
Thanks for reviewing the patch.
<#secure method=pgpmime mode=sign>
On Wed, 22 Jul 2026 at 10:47, Michael Paquier <michael@paquier.xyz> wrote:
> On Tue, Jul 21, 2026 at 06:16:27PM +0800, Japin Li wrote:
>> + place = EMSG;
>> + optind++;
>> +
>> if (optstring[0] == ':')
>> return BADARG;
>>
>> @@ -153,9 +156,6 @@ retry:
>> "%s: option requires an argument -- %s\n",
>> argv[0], place);
>>
>> - place = EMSG;
>> - optind++;
>> -
>> if (has_arg == required_argument)
>> return BADCH;
>> optarg = NULL;
>
> This also means that for long options we have an error message would
> now use an empty string instead of an option name all the time. That
> looks incorrect.
Right. I was mistaken about the option name. Fixed in v2-0002.
>
> You are claiming that this makes the short option path more
> consistent. That's true based on what your patch does, but it also
> looks to me like the short option area is already wrong in setting
> EMSG before we issue the error string "option requires an argument".
> So, to me, you are making the situation worse in some cases while
> claiming that it improves the situation in some other cases.
>
> Our implementation of getopt_long() is only used on Windows for MSVC,
> as far as I know. I'd also suggest to post one or more examples of
> how this changes the implementation behavior. You should be able to
> force your way through easily so as the Postgres getopt_long()
> implementation is used with a quick hack, just to prove your point,
> saving you the pain of deploying a WIN32 host.. (Like use a
> pg_getopt_long() and patch one of the binaries, whatever you prefer.)
Here's a mini‑demo for getopt_long() in v2‑0001. Without v2‑0002, the output is:
$ ./getopt_long_test --log-filename
option './getopt_long_test' requires an argument
unrecognized option './getopt_long_test'
unrecognized option './getopt_long_test'
unrecognized option './getopt_long_test'
unrecognized option './getopt_long_test'
$ ./getopt_long_test -f
option '-f' requires an argument
With v2‑0002 applied, the output is:
$ ./getopt_long_test --log-filename
option '--log-filename' requires an argument
$ ./getopt_long_test -f
option '-f' requires an argument
> --
> Michael
--
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.
^ permalink raw reply [nested|flat] 467+ messages in thread
* Re: Fix optind handling inconsistency in getopt_long() for missing argument
2026-07-21 10:16 Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 01:47 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
2026-07-22 04:17 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
@ 2026-07-22 04:22 ` Japin Li <japinli@hotmail.com>
2026-07-31 03:48 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
0 siblings, 1 reply; 467+ messages in thread
From: Japin Li @ 2026-07-22 04:22 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; +Cc: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>
On Wed, 22 Jul 2026 at 12:17, Japin Li <japinli@hotmail.com> wrote:
> Hi, Michael
>
> Thanks for reviewing the patch.
>
> <#secure method=pgpmime mode=sign>
> On Wed, 22 Jul 2026 at 10:47, Michael Paquier <michael@paquier.xyz> wrote:
>> On Tue, Jul 21, 2026 at 06:16:27PM +0800, Japin Li wrote:
>>> + place = EMSG;
>>> + optind++;
>>> +
>>> if (optstring[0] == ':')
>>> return BADARG;
>>>
>>> @@ -153,9 +156,6 @@ retry:
>>> "%s: option requires an argument -- %s\n",
>>> argv[0], place);
>>>
>>> - place = EMSG;
>>> - optind++;
>>> -
>>> if (has_arg == required_argument)
>>> return BADCH;
>>> optarg = NULL;
>>
>> This also means that for long options we have an error message would
>> now use an empty string instead of an option name all the time. That
>> looks incorrect.
>
> Right. I was mistaken about the option name. Fixed in v2-0002.
>
>>
>> You are claiming that this makes the short option path more
>> consistent. That's true based on what your patch does, but it also
>> looks to me like the short option area is already wrong in setting
>> EMSG before we issue the error string "option requires an argument".
>> So, to me, you are making the situation worse in some cases while
>> claiming that it improves the situation in some other cases.
>>
>> Our implementation of getopt_long() is only used on Windows for MSVC,
>> as far as I know. I'd also suggest to post one or more examples of
>> how this changes the implementation behavior. You should be able to
>> force your way through easily so as the Postgres getopt_long()
>> implementation is used with a quick hack, just to prove your point,
>> saving you the pain of deploying a WIN32 host.. (Like use a
>> pg_getopt_long() and patch one of the binaries, whatever you prefer.)
>
> Here's a mini‑demo for getopt_long() in v2‑0001. Without v2‑0002, the output is:
>
> $ ./getopt_long_test --log-filename
> option './getopt_long_test' requires an argument
> unrecognized option './getopt_long_test'
> unrecognized option './getopt_long_test'
> unrecognized option './getopt_long_test'
> unrecognized option './getopt_long_test'
> $ ./getopt_long_test -f
> option '-f' requires an argument
>
> With v2‑0002 applied, the output is:
>
> $ ./getopt_long_test --log-filename
> option '--log-filename' requires an argument
> $ ./getopt_long_test -f
> option '-f' requires an argument
>
>> --
>> Michael
>
Sorry, I forgot to include the patches in my previous email.
> --
> Regards,
> Japin Li
> ChengDu WenWu Information Technology Co., Ltd.
--
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.
^ permalink raw reply [nested|flat] 467+ messages in thread
* Re: Fix optind handling inconsistency in getopt_long() for missing argument
2026-07-21 10:16 Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 01:47 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
2026-07-22 04:17 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 04:22 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
@ 2026-07-31 03:48 ` Michael Paquier <michael@paquier.xyz>
2026-07-31 05:27 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
0 siblings, 1 reply; 467+ messages in thread
From: Michael Paquier @ 2026-07-31 03:48 UTC (permalink / raw)
To: Japin Li <japinli@hotmail.com>; +Cc: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>
On Wed, Jul 22, 2026 at 12:22:06PM +0800, Japin Li wrote:
> On Wed, 22 Jul 2026 at 12:17, Japin Li <japinli@hotmail.com> wrote:
>> With v2‑0002 applied, the output is:
>>
>> $ ./getopt_long_test --log-filename
>> option '--log-filename' requires an argument
>> $ ./getopt_long_test -f
>> option '-f' requires an argument
Thanks, that saves time. I have been also checking how libc behaves,
debugging more information with optind, argv, optarg, opterr and
optopt with the short and long cases.
One side note: optopt still remains inconsistent compared to our port
version. Not sure if this is worth caring about.. Mentioning
in passing.
> Sorry, I forgot to include the patches in my previous email.
No problem. That happens.
Adjusted on HEAD.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (833B, ../../amwa9nvUdE5QneAD@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 467+ messages in thread
* Re: Fix optind handling inconsistency in getopt_long() for missing argument
2026-07-21 10:16 Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 01:47 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
2026-07-22 04:17 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-22 04:22 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-31 03:48 ` Re: Fix optind handling inconsistency in getopt_long() for missing argument Michael Paquier <michael@paquier.xyz>
@ 2026-07-31 05:27 ` Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-31 05:27 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; +Cc: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>
References: <SY7PR01MB10921AF81F18A8BCFA06388BEB6C22@SY7PR01MB10921.ausprd01.prod.outlook.com>
<amAhNvNM4I4ATevL@paquier.xyz>
<SY7PR01MB10921B103CBDC8A0128D156B5B6C12@SY7PR01MB10921.ausprd01.prod.outlook.com>
<SY7PR01MB109210E2A46D09049F98D185AB6C12@SY7PR01MB10921.ausprd01.prod.outlook.com>
<amwa9nvUdE5QneAD@paquier.xyz>
User-Agent: mu4e 1.14.1; emacs 30.2
Date: Fri, 31 Jul 2026 13:27:31 +0800
<#secure method=pgpmime mode=sign>
On Fri, 31 Jul 2026 at 12:48, Michael Paquier <michael@paquier.xyz> wrote:
> On Wed, Jul 22, 2026 at 12:22:06PM +0800, Japin Li wrote:
>> On Wed, 22 Jul 2026 at 12:17, Japin Li <japinli@hotmail.com> wrote:
>>> With v2‑0002 applied, the output is:
>>>
>>> $ ./getopt_long_test --log-filename
>>> option '--log-filename' requires an argument
>>> $ ./getopt_long_test -f
>>> option '-f' requires an argument
>
> Thanks, that saves time. I have been also checking how libc behaves,
> debugging more information with optind, argv, optarg, opterr and
> optopt with the short and long cases.
>
> One side note: optopt still remains inconsistent compared to our port
> version. Not sure if this is worth caring about.. Mentioning
> in passing.
>
>> Sorry, I forgot to include the patches in my previous email.
>
> No problem. That happens.
>
> Adjusted on HEAD.
Thank you!
> --
> Michael
--
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
* [PATCH v2 2/2] Fix optind handling inconsistency in getopt_long() for missing argument
@ 2026-07-22 03:59 Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 467+ messages in thread
From: Japin Li @ 2026-07-22 03:59 UTC (permalink / raw)
In the long option error path for a missing required argument, the code
previously checked optstring[0] == ':' and returned BADARG immediately
without incrementing optind and setting place = EMSG. This left optind
and place in an inconsistent state compared to the short option path,
where these updates are performed before the check and return.
---
src/port/getopt_long.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/port/getopt_long.c b/src/port/getopt_long.c
index 20953db9db1..2e869fed58b 100644
--- a/src/port/getopt_long.c
+++ b/src/port/getopt_long.c
@@ -145,8 +145,12 @@ retry:
}
else
{
+ optind++;
if (optstring[0] == ':')
+ {
+ place = EMSG;
return BADARG;
+ }
if (opterr && has_arg == required_argument)
fprintf(stderr,
@@ -154,7 +158,6 @@ retry:
argv[0], place);
place = EMSG;
- optind++;
if (has_arg == required_argument)
return BADCH;
--
2.53.0
--=-=-=--
^ permalink raw reply [nested|flat] 467+ messages in thread
end of thread, other threads:[~2026-07-31 05:27 UTC | newest]
Thread overview: 467+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-06-03 17:15 [PATCH v9a 16/22] ci: Formatting, Naming and consistency improvements Andres Freund <andres@anarazel.de>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-07-21 09:49 [PATCH v1] Fix optind handling inconsistency in getopt_long() for missing argument Japin Li <japinli@hotmail.com>
2026-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