summaryrefslogtreecommitdiffstats
path: root/usr.bin/getopt/getopt.c
Commit message (Collapse)AuthorAgeFilesLines
* ANSIify function definitions.dwmalone2002-09-041-3/+1
| | | | | | | | | Add some constness to avoid some warnings. Remove use register keyword. Deal with missing/unneeded extern/prototypes. Some minor type changes/casts to avoid warnings. Reviewed by: md5
* Consistently use FBSDIDobrien2002-06-301-1/+2
|
* Minor nit; return(foo) from main rather than exit(foo).markm2002-04-281-1/+1
|
* Warns cleanup (just make main return an int).dwmalone2001-12-031-0/+1
|
* Include missing header files which define functions for which gcc hasdd2001-06-241-0/+1
| | | | builtins (e.g., exit, strcmp).
* getopt and friends are declared in <unistd.h>imp2000-09-041-2/+3
| | | | getopt returns -1 not EOF.
* Back out part of previous commit.cracauer1999-04-041-1/+1
| | | | | | | | | Arguments with whitespaces are easy to fix, but in combination with shell metachars that should not be evaluated it is very hard, probably impossible to fix without going to a line-oriented solution. Next time I will believe Henry Spencer when he says "this looks easy to fix but isn't".
* 1) Fix the case where a shellscript using getopt is called with acracauer1999-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | parameter that has space in it, both in getopt.c and in the manpage example. 2) Fix the example in the manpage. The set(1) command is required to return 0 (POSIX 1003.2, section 3.14.11), so you can't test for getopt's exit status like the example did: #! /bin/sh set -- `getopt abo: $*` if test $? != 0 # wrong, tests for set's exit status, which is # always zero, no for getopt(1)'s. Fixes PR bin/5845, which thought it was getopt's fault, but in fact the manpage was wrong. I also updated the example to be more useful and updated the BUGS section. PR: bin/5845
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-291-1/+1
| | | | posix standard on the topic.
* Added getopt(1) from NetBSDnate1993-07-261-0/+30
OpenPOWER on IntegriCloud