History log of /netbsd-src/lib/libc/stdlib/getopt_long.c (Results 1 – 25 of 28)
Revision Date Author Comments
# 689fdc58 19-Jan-2024 christos <christos@NetBSD.org>

add some const


# 1c79b1c7 01-Sep-2015 kamil <kamil@NetBSD.org>

ANSIfy getopt(3) - this is the REPLACE_GETOPT version from getopt_long(3)

For the reference, this version still passes the current set of ATF tests
for the getopt(3) function.

This version is by de

ANSIfy getopt(3) - this is the REPLACE_GETOPT version from getopt_long(3)

For the reference, this version still passes the current set of ATF tests
for the getopt(3) function.

This version is by default unused.

show more ...


# 596fd566 01-Sep-2015 kamil <kamil@NetBSD.org>

Constness correction for the getopt(3) function under REPLACE_GETOPT

Use the __UNCONST() macro, which is used in the other parts for the same
argument nargv, but under the !REPLACE_GETOPT namespace.


# cc420b6c 20-Mar-2009 joerg <joerg@NetBSD.org>

ANSIfy. Remove conditionals around __RCSID.


# 0405bf4c 09-Nov-2007 christos <christos@NetBSD.org>

always compile getopt_long. some ifdef reduction. more to come.


# b3b90d74 06-Nov-2007 christos <christos@NetBSD.org>

Revert previous. This mess of ifdefs needs to be killed.


# 9df03145 06-Nov-2007 christos <christos@NetBSD.org>

move the test to replace getopt higher up, before we need to include anything.


# 15b661ab 05-Jul-2007 ginsbach <ginsbach@NetBSD.org>

Fix several end cases:

o If a long option looks like an ambiguous abbreviation of two or more long
options, but all the possible interpretations would return the same
value, then just return tha

Fix several end cases:

o If a long option looks like an ambiguous abbreviation of two or more long
options, but all the possible interpretations would return the same
value, then just return that value without complaining that it's
ambiguous.

o If a long option could be interpreted either as an exact match for one
long option, or as an abbreviation for one or more other long options,
then treat it as the exact match.

These changes align NetBSD's getopt_long(3) with the current behavior of
GNU getopt_long(3), the de facto standard, and FreeBSD's getopt_long(3).

show more ...


# ec15e07b 04-Oct-2006 wiz <wiz@NetBSD.org>

Switch from 4-clause to 2-clause BSD license.
Ok dillo@, board@.


# 9de32b7f 02-Dec-2005 yamt <yamt@NetBSD.org>

don't make internal functions pretend to take a const argument.


# 03256c6e 29-Nov-2005 christos <christos@NetBSD.org>

WARNS=4


# b2f78261 20-Jun-2004 jmc <jmc@NetBSD.org>

Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulti

Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944

show more ...


# 171d6532 27-Oct-2003 lukem <lukem@NetBSD.org>

Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/com

Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).

show more ...


# 9fbd8888 31-Jan-2002 tv <tv@NetBSD.org>

Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __C

Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.

show more ...


# a328e341 29-Jan-2002 tv <tv@NetBSD.org>

Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)


# 50f5afd5 04-Nov-2001 lukem <lukem@NetBSD.org>

fix WARNS=2 (-Wshadow) warnings


# 77dec036 24-Apr-2001 joda <joda@NetBSD.org>

don't claim that options are illegal, cf lib/12715


# e76f9e34 12-Feb-2001 cgd <cgd@NetBSD.org>

don't extern char *__progname; it's never used!


# c5b9e1ce 04-Jan-2001 lukem <lukem@NetBSD.org>

sprinkle _DIAGASSERT() around


# e7775dbf 26-Nov-2000 wiz <wiz@NetBSD.org>

Be SUS-conformant regarding return value when option argument is missing.
Handle "-" correctly.


# a3fe3d3c 25-Aug-2000 thorpej <thorpej@NetBSD.org>

Some (popular) programs expect to be able to re-initialize `optind'
to 0 and have getopt(3)/getopt_long(3) continue to function properly.
This happens to work with GNU getopt_long(3), so mimmick the

Some (popular) programs expect to be able to re-initialize `optind'
to 0 and have getopt(3)/getopt_long(3) continue to function properly.
This happens to work with GNU getopt_long(3), so mimmick the behavior.

Fixes pkg/10980 (Manuel Bouyer): rsyncd was relying on this behavior.

show more ...


# ac7a8f6b 08-Jul-2000 sommerfeld <sommerfeld@NetBSD.org>

Correct format mismatch for field widths


# 045f0427 09-Jun-2000 nathanw <nathanw@NetBSD.org>

Don't segfault when complaining about an invalid single-character option.

When complaining about a long option which requires an argument,
print the actual option, not some pointer-garbage.

(Hint:

Don't segfault when complaining about an invalid single-character option.

When complaining about a long option which requires an argument,
print the actual option, not some pointer-garbage.

(Hint: "%c" and "%s" are different.)

show more ...


# 6d34da15 02-Apr-2000 christos <christos@NetBSD.org>

Add "namespace.h" and include <getopt.h> since we moved the stuff out
of <unistd.h>


# 6dfafca1 02-Apr-2000 christos <christos@NetBSD.org>

New getopt_long from Thomas Klausner and Dieter Baron


12