summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/stdlib/getopt_long.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/libc/stdlib/getopt_long.c b/src/lib/libc/stdlib/getopt_long.c
index 413ec24f4e..0cdc4d652f 100644
--- a/src/lib/libc/stdlib/getopt_long.c
+++ b/src/lib/libc/stdlib/getopt_long.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getopt_long.c,v 1.10 2002/12/08 17:52:26 millert Exp $ */ 1/* $OpenBSD: getopt_long.c,v 1.11 2002/12/10 17:51:42 millert Exp $ */
2/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */ 2/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
3 3
4/* 4/*
@@ -64,7 +64,7 @@
64 */ 64 */
65 65
66#if defined(LIBC_SCCS) && !defined(lint) 66#if defined(LIBC_SCCS) && !defined(lint)
67static char *rcsid = "$OpenBSD: getopt_long.c,v 1.10 2002/12/08 17:52:26 millert Exp $"; 67static char *rcsid = "$OpenBSD: getopt_long.c,v 1.11 2002/12/10 17:51:42 millert Exp $";
68#endif /* LIBC_SCCS and not lint */ 68#endif /* LIBC_SCCS and not lint */
69 69
70#include <err.h> 70#include <err.h>
@@ -348,8 +348,9 @@ start:
348 nonopt_start = nonopt_end = -1; 348 nonopt_start = nonopt_end = -1;
349 return (-1); 349 return (-1);
350 } 350 }
351 if (*(place = nargv[optind]) != '-') { /* found non-option */ 351 if (*(place = nargv[optind]) != '-' ||
352 place = EMSG; 352 (place[1] == '\0' && strchr(options, '-') == NULL)) {
353 place = EMSG; /* found non-option */
353 if (flags & FLAG_ALLARGS) { 354 if (flags & FLAG_ALLARGS) {
354 /* 355 /*
355 * GNU extension: 356 * GNU extension: