NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/59443: getopt/getopt_long prints errors when +/- is present before :



The following reply was made to PR lib/59443; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: "Haelwenn (lanodan) Monnier" <contact+netbsd.org%hacktivis.me@localhost>
Cc: gnats-bugs%netbsd.org@localhost
Subject: Re: lib/59443: getopt/getopt_long prints errors when +/- is present
 before :
Date: Tue, 27 May 2025 07:05:08 +0200

 On Tue, May 27, 2025 at 04:55:25AM +0200, Haelwenn (lanodan) Monnier wrote:
 > And as far as I can tell, this code seems like it should match the
 > expected behavior:
 > https://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdlib/getopt_long.c?rev=1.28
 
 Maybe unrelated, but I think there is a bug in the man page:
 
      o    return value in case of missing argument if first character (after +
           or -) in option string is not ':':
 
           GNU     returns '?'
 
           NetBSD  returns ':' (since NetBSD's getopt does).
 
 The 
 
 	is not ':'
 
 is inverted, isn't it? NetBSD returns : if the first char is ':'
 (otherwise '?'), at least that is what I think getopt(3) says.
 
 
 Martin
 


Home | Main Index | Thread Index | Old Index