Commit Graph

11 Commits

Author SHA1 Message Date
cgd e76f9e3425 don't extern char *__progname; it's never used! 2001-02-12 23:59:17 +00:00
lukem c5b9e1cef5 sprinkle _DIAGASSERT() around 2001-01-04 03:35:29 +00:00
wiz e7775dbf9e Be SUS-conformant regarding return value when option argument is missing.
Handle "-" correctly.
2000-11-26 23:39:11 +00:00
thorpej a3fe3d3cf9 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.
2000-08-25 17:05:49 +00:00
sommerfeld ac7a8f6bc2 Correct format mismatch for field widths 2000-07-08 14:58:43 +00:00
nathanw 045f0427b1 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.)
2000-06-09 21:35:53 +00:00
christos 6d34da153c Add "namespace.h" and include <getopt.h> since we moved the stuff out
of <unistd.h>
2000-04-02 22:04:06 +00:00
christos 6dfafca13a New getopt_long from Thomas Klausner and Dieter Baron 2000-04-02 20:27:58 +00:00
lukem d896261208 back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
1999-09-20 04:38:56 +00:00
lukem b48252f365 * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
  and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

		_DIAGASSERT(path != NULL)
	#ifdef _DIAGNOSTIC
		if (path == NULL) {
			errno = EFAULT;
			return (-1);
		}
	#endif
1999-09-16 11:44:54 +00:00
mcr 62da59d7b4 getopt long functionality 1999-07-23 03:55:27 +00:00