Dear Sirs,

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.

At present I don't have a fix.

Best luck,
Mirsad Todorovac
[EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to