aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdlib/getopt.c
AgeCommit message (Collapse)AuthorFilesLines
2018-06-18newlib: getopt now permutes multi-flag options correctlyThomas Kindler1-12/+21
Previously, "test 1 2 3 -a -b -c" was permuted to "test -a -b -c 1 2 3", but "test 1 2 3 -abc" was left as "test 1 2 3 -abc". Signed-off-by: Thomas Kindler <mail+newlib@t-kindler.de>
2013-11-13 * newlib/libc/stdlib/getopt.c (getopt_internal): Add missing braces.Corinna Vinschen1-12/+16
2013-11-13 * newlib/libc/include/getopt.h (struct option): name field should beCorinna Vinschen1-14/+22
"const char *". * newlib/libc/stdlib/getopt.c (getopt_internal): Use fputs()/fputc() instead of fprintf() to save code space. Fix signed/unsigned comparison.
2013-11-12 * libc/libc/stdlib/getopt.c (getopt_internal): Fix NULL pointer access.Corinna Vinschen1-0/+4
2012-10-16 * libc/stdlib/getopt.c (getopt_internal): Align handling of colon toCorinna Vinschen1-5/+27
SUSv4 requirements. (__getopt_long_r): Fix formatting.
2008-03-072008-03-07 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston1-0/+4
* libc/include/getopt.h: Hide newlib extensions under the __need_getopt_newlib flag. * libc/stdlib/getopt.c: #define __need_getopt_newlib before including getopt.h. Put entire code under !HAVE_GETOPT to support platforms with their own getopt implementation. * configure.host: Specify HAVE_GETOPT for x86-linux.
2008-02-292008-02-29 Gregory Pietsch <gpietsch@comcast.net>Jeff Johnston1-175/+249
* libc/stdlib/getopt.c (getopt_internal): Rewrite to accept data area so as to support reentrant calls. Change all callers to fill in data area with global values and restore any changes to the global values after call. (__getopt_r, __getopt_long_r, __getopt_long_only_r): New routines to support reentrancy that add a data area argument. * libc/include/getopt.h: Add new _r routines and provide macros so they can be called with using double-underscores.
2008-02-122008-02-12 Peter Rosin <peda@lysator.liu.se>Jeff Johnston1-7/+2
* libc/stdlib/getopt.c (getopt_internal): Handle optional arguments better for long options and short options not appearing as the first option in a sequence.
2007-05-29Avoid more compiler warnings.Eric Blake1-1/+1
* libc/stdlib/btowc.c: Add missing header. * libc/stdlib/getopt.c (getopt_internal): Initialize variable. * libc/stdlib/system.c (do_system) [__CYGWIN__]: Add declaration. * libc/stdlib/wctob.c: Add missing header. * libc/string/strcpy.c (strcpy): Avoid warnings. * libc/string/strrchr.c (strrchr): Likewise.
2006-01-042006-01-04 Gregory Pietsch <gpietsch@comcast.net>Jeff Johnston1-107/+396
* libc/stdlib/getopt.c: Replaced with version that adds getopt_long and getopt_long_only support. * libc/include/getopt.h: New file.
2000-02-17import newlib-2000-02-17 snapshotChristopher Faylor1-0/+117