18 Mar
2012
18 Mar
'12
1:53 p.m.
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. -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh