On Sun, Mar 18, 2012 at 10:53:32AM -0300, Henrique de Moraes Holschuh wrote:
According to POSIX, dirname() is allowed to modify the string passed to it. In fact, according to dirname(3), glibc's will do just that when libgen.h is in use. The manpage even warns you that it will segfault when passed a constant that cannot be modified...
Well, I hit that bug and it took a while to track it down. --enable-debug seems to link a different dirname() that is less crappy, so the bug wouldn't show up in debug builds.
The attached patch explains it better.
Thanks, merged. -- Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."