From c94e5bebf56c687d9580ddca6ce99b3744c2b175 Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 6 Mar 2004 14:24:10 +0000 Subject: Make GNU-compatible following case: single '-' in command line and '-' (non-first) in options --- lib/libc/stdlib/getopt_long.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/libc/stdlib/getopt_long.c') diff --git a/lib/libc/stdlib/getopt_long.c b/lib/libc/stdlib/getopt_long.c index 74f8aa0..dfaff42 100644 --- a/lib/libc/stdlib/getopt_long.c +++ b/lib/libc/stdlib/getopt_long.c @@ -413,7 +413,11 @@ start: return (-1); } if (*(place = nargv[optind]) != '-' || +#ifdef GNU_COMPATIBLE + place[1] == '\0') { +#else (place[1] == '\0' && strchr(options, '-') == NULL)) { +#endif place = EMSG; /* found non-option */ if (flags & FLAG_ALLARGS) { /* -- cgit v1.1