History log of /freebsd-12.1/lib/libc/stdlib/getopt_long.c (Results 1 – 19 of 19)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0
# da265c17 21-Jan-2019 Kyle Evans <[email protected]>

MFC r342757: getopt_long(3): fix case of malformed long opt

When presented with an arg string like '-l-', getopt_long will successfully
parse out the 'l' short option, then proceed to match '--' aga

MFC r342757: getopt_long(3): fix case of malformed long opt

When presented with an arg string like '-l-', getopt_long will successfully
parse out the 'l' short option, then proceed to match '--' against the first
longopts entry as it later does a strncmp with len=0. This latter bit is
arguably another bug in itself, but presumably not a practical issue as all
callers of parse_long_options are already doing the right thing (except this
one pointed out).

An opt string like '-l-' should be considered malformed and throw a bad
argument rather than behaving as if '--' were passed. It cannot possibly do
what the invoker expects, and it's probably the result of a typo (ls -l- a)
rather than any intent.

show more ...


Revision tags: release/12.0.0, release/11.2.0, release/10.4.0, release/11.1.0, release/11.0.1, release/11.0.0, release/10.3.0, release/10.2.0, release/10.1.0, release/9.3.0
# 298207c3 22-Jun-2014 Andrey A. Chernov <[email protected]>

Merge intermediate OpenBSD v1.25 changes (almost identical to ours)
to reduce diff and bump OpenBSD patch level to v1.26.

MFC after: 2 weeks


# 6aa22516 22-Jun-2014 Pedro F. Giffuni <[email protected]>

getopt(3): recognize option:: as GNU extension for "optional options".

Also ANSIfy a function declaration.

While here update the OpenBSD patch level in getopt_long.c as we
already have the correspo

getopt(3): recognize option:: as GNU extension for "optional options".

Also ANSIfy a function declaration.

While here update the OpenBSD patch level in getopt_long.c as we
already have the corresponding change.

Obtained from: NetBSD
MFC after: 2 weeks

show more ...


Revision tags: release/10.0.0, release/9.2.0, release/8.4.0, release/9.1.0
# 1b74dc4a 11-Jun-2012 Xin LI <[email protected]>

Switch from 4-clause to 2-clause BSD license. (OpenBSD r1.22)
No functional change.

Obtained from: NetBSD via OpenBSD


Revision tags: release/8.3.0, release/7.4.0, release/8.2.0, release/8.1.0, release/7.3.0, release/8.0.0, release/7.2.0, release/7.1.0, release/6.4.0, release/7.0.0, release/6.3.0, release/6.2.0
# d3ff3b5f 23-Sep-2006 Andrey A. Chernov <[email protected]>

Keep compatible parts in sync with OpenBSD v1.21, add some comments.
No functional changes.


# 6843acf8 22-Sep-2006 Andrey A. Chernov <[email protected]>

Remove code #ifndef'ed in prev. commit to stay in sync with OpenBSD
v1.21 which just do that.


# f27c7b47 22-Sep-2006 Andrey A. Chernov <[email protected]>

Be more GNU compatible:
don't be greedy on the GNU "::" extension when arg separated by whitespace
and POSIX_CORRECTLY is set. From POSIX point of view this is unclear
situation, so minimal assumptio

Be more GNU compatible:
don't be greedy on the GNU "::" extension when arg separated by whitespace
and POSIX_CORRECTLY is set. From POSIX point of view this is unclear
situation, so minimal assumption looks right.

show more ...


Revision tags: release/5.5.0, release/6.1.0, release/6.0.0, release/5.4.0, release/4.11.0, release/5.3.0
# 42aeacc4 06-Jul-2004 Andrey A. Chernov <[email protected]>

Keep it sync with OpenBSD:
An optional argument cannot start with '-', even if permutation is
disabled.

Obtained from: OpenBSD getopt_long.c v1.17


Revision tags: release/4.10.0
# f853699a 01-Apr-2004 Andrey A. Chernov <[email protected]>

Simplify one condition in prev. commit:
short_too already assumes FLAG_LONGONLY


# ed4fbbd5 01-Apr-2004 Andrey A. Chernov <[email protected]>

Fix parsing of ambiguous options, whole loop must be processed


# 3700175b 06-Mar-2004 Andrey A. Chernov <[email protected]>

Make GNU-compatible following case:
single '-' in command line and '-' (non-first) in options


# 88485399 03-Mar-2004 Andrey A. Chernov <[email protected]>

Make return code in noarg case GNU-compatible


# 9f06a99e 03-Mar-2004 Andrey A. Chernov <[email protected]>

Be more GNU-compatible in diagnostics


# f2fd86b7 01-Mar-2004 Andrey A. Chernov <[email protected]>

Improve GNU compatibility in several places, use internal GNU_COMPATIBLE
define for it.
Don't catch POSIXLY_CORRECT env. into static variable, it can be changed
on the fly by program.
Use P1003.2 sta

Improve GNU compatibility in several places, use internal GNU_COMPATIBLE
define for it.
Don't catch POSIXLY_CORRECT env. into static variable, it can be changed
on the fly by program.
Use P1003.2 standartized illoptchar[]

show more ...


# ee43cb7a 01-Mar-2004 Andrey A. Chernov <[email protected]>

Change "-"-started options when POSIX_CORRECTLY is set handling
in favour of GNU instead of NetBSD, because configure's use us and
expect GNU.


# 829a229d 24-Feb-2004 Andrey A. Chernov <[email protected]>

Add getopt_long_only() from OpenBSD and other OpenBSD cleanups

PR: 63173
Submitted by: Marius Strobl <[email protected]>


Revision tags: release/5.2.1
# f3b62198 20-Feb-2004 Ruslan Ermilov <[email protected]>

Unbreak the upgrade path from 4.9 after removal of GNU getopt and
<gnuregex.h>.


Revision tags: release/5.2.0, release/4.9.0, release/5.1.0, release/4.8.0, release/5.0.0
# e6fc380c 16-Oct-2002 Alfred Perlstein <[email protected]>

de-__P()


# a35a7e76 29-Sep-2002 Eric Melville <[email protected]>

Add getopt_long(3).

Obtained from: NetBSD
Sponsored by: Apple