public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/11039] getopt mishandles optstring of "+:"
       [not found] <bug-11039-131@http.sourceware.org/bugzilla/>
@ 2014-06-30 20:36 ` fweimer at redhat dot com
  0 siblings, 0 replies; 4+ messages in thread
From: fweimer at redhat dot com @ 2014-06-30 20:36 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=11039

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/11039] getopt mishandles optstring of "+:"
  2009-12-01 16:28 [Bug libc/11039] New: " ebb9 at byu dot net
  2009-12-01 16:32 ` [Bug libc/11039] " ebb9 at byu dot net
  2009-12-02 22:17 ` ebb9 at byu dot net
@ 2010-04-08  0:57 ` drepper at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: drepper at redhat dot com @ 2010-04-08  0:57 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2010-04-08 00:56 -------
Fixed in git.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/11039] getopt mishandles optstring of "+:"
  2009-12-01 16:28 [Bug libc/11039] New: " ebb9 at byu dot net
  2009-12-01 16:32 ` [Bug libc/11039] " ebb9 at byu dot net
@ 2009-12-02 22:17 ` ebb9 at byu dot net
  2010-04-08  0:57 ` drepper at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: ebb9 at byu dot net @ 2009-12-02 22:17 UTC (permalink / raw)
  To: glibc-bugs


------- 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 <unistd.h>
#include <stdio.h>
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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/11039] getopt mishandles optstring of "+:"
  2009-12-01 16:28 [Bug libc/11039] New: " ebb9 at byu dot net
@ 2009-12-01 16:32 ` ebb9 at byu dot net
  2009-12-02 22:17 ` ebb9 at byu dot net
  2010-04-08  0:57 ` drepper at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: ebb9 at byu dot net @ 2009-12-01 16:32 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From ebb9 at byu dot net  2009-12-01 16:32 -------
Created an attachment (id=4435)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4435&action=view)
patch

2009-12-01  Eric Blake	<ebb9@byu.net>

	* posix/getopt.c (_getopt_internal_r): Skip optional - or + before
	checking lead byte of optstring for :.


-- 


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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-30 20:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-11039-131@http.sourceware.org/bugzilla/>
2014-06-30 20:36 ` [Bug libc/11039] getopt mishandles optstring of "+:" fweimer at redhat dot com
2009-12-01 16:28 [Bug libc/11039] New: " ebb9 at byu dot net
2009-12-01 16:32 ` [Bug libc/11039] " ebb9 at byu dot net
2009-12-02 22:17 ` ebb9 at byu dot net
2010-04-08  0:57 ` drepper at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).