NetBSD Problem Report #42596

From www@NetBSD.org  Sat Jan  9 00:29:33 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 4F52663C504
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  9 Jan 2010 00:29:33 +0000 (UTC)
Message-Id: <20100109002933.1D5D463C503@www.NetBSD.org>
Date: Sat,  9 Jan 2010 00:29:33 +0000 (UTC)
From: anthony.mallet@useless-ficus.net
Reply-To: anthony.mallet@useless-ficus.net
To: gnats-bugs@NetBSD.org
Subject: getopt_long(3) manual does not mention + and - leading character in optstring parameter
X-Send-Pr-Version: www-1.0

>Number:         42596
>Category:       lib
>Synopsis:       getopt_long(3) manual does not mention + and - leading character in optstring parameter
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 09 00:30:01 +0000 2010
>Originator:     Anthony Mallet
>Release:        -current
>Organization:
>Environment:
NetBSD ficus 5.99.22 NetBSD 5.99.22 (FICUS) #9: Sat Nov 14 12:49:00 CET 2009  troot@ficus:/usr/obj/sys/arch/i386/compile/FICUS i386
>Description:
getopt_long(3) manual does not mention the special case where the
initial character of the optstring parameter is '+' or '-', except
extremely briefly in the implementation differences with glibc.


For reference, here is the relevant paragraph found in glibc-2.10.1:
``
By default, getopt() permutes the contents of argv as it scans, so that
eventually all the non-options are at the end.   Two  other  modes  are
also  implemented.   If  the first character of optstring is '+' or the
environment variable POSIXLY_CORRECT is  set,  then  option  processing
stops  as  soon  as a non-option argument is encountered.  If the first
character of optstring is '-', then  each  non-option  argv-element  is
handled  as if it were the argument of an option with character code 1.
''

>How-To-Repeat:
man 3 getopt_long

>Fix:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.