From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30486 invoked by alias); 2 Dec 2009 22:17:41 -0000 Received: (qmail 30044 invoked by uid 48); 2 Dec 2009 22:17:26 -0000 Date: Wed, 02 Dec 2009 22:17:00 -0000 Message-ID: <20091202221726.30043.qmail@sourceware.org> From: "ebb9 at byu dot net" To: glibc-bugs@sources.redhat.com In-Reply-To: <20091201162750.11039.ebb9@byu.net> References: <20091201162750.11039.ebb9@byu.net> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/11039] getopt mishandles optstring of "+:" X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2009-12/txt/msg00013.txt.bz2 ------- Additional Comments From ebb9 at byu dot net 2009-12-02 22:17 ------- Another related problem, which is also fixed by the previously posted patch: $ cat foo.c #include #include int main (int argc, char **argv) { int i, c; for (i = 0; i <= 1; i++) { optind = i; c = getopt (argc, argv, "+a"); if (c == -1) printf ("got -1, optind %d\n", optind); else printf ("got %c, optind %d\n", c, optind); } return 0; } $ ./foo -+ foo: invalid option -- '+' got ?, optind 2 got +, optind 2 Expected behavior is for the error message to occur twice on stderr, with both passes returning '?'. -- http://sourceware.org/bugzilla/show_bug.cgi?id=11039 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.