#18710 [Com]: dirname("/") returns ("\")

From: Date: Wed, 25 Aug 2004 13:28:50 +0000
Subject: #18710 [Com]: dirname("/") returns ("\")
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-65229@lists.php.net to get a copy of this message
ID: 18710 Comment by: renegaderesearch at hotpop dot com Reported By: duncan at emarketeers dot com Status: Closed Bug Type: *Directory/Filesystem functions Operating System: Windows 2000 PHP Version: 4.2.2 New Comment: I'm still getting this error in PHP 4.3.8. Any chance of getting this bug open again? There really needs to be something in the documentation too. Like Duncan said it's a real problem for portable code. Replacing / with \ in a URL will even screw up Firefox. Previous Comments: ------------------------------------------------------------------------ [2002-08-02 14:18:02] duncan at emarketeers dot com dirname() in windows works inconsistently. dirname("/a/b") returns "/a" but dirname("/") returns "\" This makes writing portable code which will work on Unix and Windows problematic. I've looked at ext/standard/string.c and I think the fix would be to replace all occurrences of DEFAULT_SLASH with "/" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18710&edit=1

« previous php.bugs (#65229) next »