From 13dd03a0e2605f0ec2da811aa814a58bc2dd9a3d Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 8 Jan 2003 11:16:48 +1100 Subject: - (djm) Sync openbsd-compat/ with OpenBSD -current --- openbsd-compat/getopt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'openbsd-compat/getopt.c') diff --git a/openbsd-compat/getopt.c b/openbsd-compat/getopt.c index 4a5cfe5f0..a3fe807ee 100644 --- a/openbsd-compat/getopt.c +++ b/openbsd-compat/getopt.c @@ -35,7 +35,7 @@ #if !defined(HAVE_GETOPT) || !defined(HAVE_GETOPT_OPTRESET) #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: getopt.c,v 1.2 1996/08/19 08:33:32 tholo Exp $"; +static char *rcsid = "$OpenBSD: getopt.c,v 1.4 2002/12/08 22:57:14 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -66,6 +66,9 @@ BSDgetopt(nargc, nargv, ostr) static char *place = EMSG; /* option letter processing */ char *oli; /* option letter list index */ + if (ostr == NULL) + return (-1); + if (BSDoptreset || !*place) { /* update scanning pointer */ BSDoptreset = 0; if (BSDoptind >= nargc || *(place = nargv[BSDoptind]) != '-') { -- cgit v1.2.3