From 2125814fb5ba46fffa335ada64f82a06912c4b78 Mon Sep 17 00:00:00 2001 From: kleink Date: Sat, 9 Jan 1999 20:31:07 +0000 Subject: [PATCH] 1003.2-92 specifies the string "--" to be recognized as the option list delimiter as opposed to any string merely beginning with '-''-'; change to match the standard. From Simon J. Gerraty in PR lib/6762. --- lib/libc/stdlib/getopt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdlib/getopt.c b/lib/libc/stdlib/getopt.c index 8c30172bba98..f49d3ee50fdf 100644 --- a/lib/libc/stdlib/getopt.c +++ b/lib/libc/stdlib/getopt.c @@ -1,4 +1,4 @@ -/* $NetBSD: getopt.c,v 1.12 1998/02/03 01:30:17 perry Exp $ */ +/* $NetBSD: getopt.c,v 1.13 1999/01/09 20:31:07 kleink Exp $ */ /* * Copyright (c) 1987, 1993, 1994 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95"; #else -__RCSID("$NetBSD: getopt.c,v 1.12 1998/02/03 01:30:17 perry Exp $"); +__RCSID("$NetBSD: getopt.c,v 1.13 1999/01/09 20:31:07 kleink Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -82,7 +82,8 @@ getopt(nargc, nargv, ostr) place = EMSG; return (-1); } - if (place[1] && *++place == '-') { /* found "--" */ + if (place[1] && *++place == '-' /* found "--" */ + && place[1] == '\0') { ++optind; place = EMSG; return (-1);