public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/10246] New: glob() with GLOB_NOCHECK is returning a modified pattern sometimes
@ 2009-06-06  5:56 psmith at gnu dot org
  2009-06-06  5:57 ` [Bug libc/10246] " psmith at gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: psmith at gnu dot org @ 2009-06-06  5:56 UTC (permalink / raw)
  To: glibc-bugs

Actually I see this with glibc 2.7-13 but there's no 2.7 in the version list?

According to POSIX, glob() with GLOB_NOCHECK should:

> If pattern does not match any pathname, then glob() shall return a list
> consisting of only pattern, and the number of matched pathnames is 1.

However, if I invoke glob() with a pattern of "//<word>" where <word> is any
non-slash-containing string that I've tried, then the resulting string is
"/<word>" with the initial slash removed.

If there are more than two initial slashes, it works fine.  Likewise if there
are extra directory levels in the pattern.

I will attach a test program I wrote:

$ gcc -o /tmp/gtest /tmp/gtest.c

$ /tmp/gtest /%
0: /bin

$ /tmp/gtest //%
0: /bin     <--incorrect!

$ /tmp/gtest ///%
0: ///%     <--OK

$/tmp/gtest //a/b
0: //a/b    <--OK

-- 
           Summary: glob() with GLOB_NOCHECK is returning a modified pattern
                    sometimes
           Product: glibc
           Version: 2.8
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: psmith at gnu dot org
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=10246

------- 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] 2+ messages in thread

* [Bug libc/10246] glob() with GLOB_NOCHECK is returning a modified pattern sometimes
  2009-06-06  5:56 [Bug libc/10246] New: glob() with GLOB_NOCHECK is returning a modified pattern sometimes psmith at gnu dot org
@ 2009-06-06  5:57 ` psmith at gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: psmith at gnu dot org @ 2009-06-06  5:57 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From psmith at gnu dot org  2009-06-06 05:57 -------
Created an attachment (id=3984)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=3984&action=view)
Test program for glob().


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10246

------- 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] 2+ messages in thread

end of thread, other threads:[~2009-06-06  5:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-06  5:56 [Bug libc/10246] New: glob() with GLOB_NOCHECK is returning a modified pattern sometimes psmith at gnu dot org
2009-06-06  5:57 ` [Bug libc/10246] " psmith at gnu dot org

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).