On Fri, Aug 15, 2008 at 9:03 AM, Mirsad Todorovac <[EMAIL PROTECTED]> wrote: > I have came across a bug in dirname() function of GNU libc. > > It is triggered by the following minimal source: > > #include <stdio.h> > #include <string.h> > > int main (int argc, char *argv[]) { > char *buf = "usr/"; > > char *word = strdup (buf); > printf ("dirname ('%s')='%s'\n", buf, dirname (word)); > free (word); > } > > The trick is to use trailing slash ('/') on path that doesn't start with > one.
Please file a bug against glibc if you think this is a bug present in the debian libc6 package. On libc6 2.7-10 for x86, your testcase works just fine: [EMAIL PROTECTED]:~$ ./test3 dirname ('usr/')='.' Cheers, Carlos. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]