dirname() implementation question
| From: | Sean R. Bright | Date: | Sat, 28 Apr 2001 18:42:02 +0000 |
| Subject: | dirname() implementation question | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-52738@lists.php.net to get a copy of this message | ||
What was the thinking behind this bit of code from dirname()
(ext/standard/string.c:799):
PHPAPI void php_dirname(char *path, int len)
{
...
/* Strip trailing slashes */ <--- This?
while (end >= path && IS_SLASH(*end)) {
end--;
}
Why are we stripping trailing slashes? My thought is that if we have
something like this:
/etc/passwd/ == Directory
/etc/passwd == File
Or was this discussed before I started reading the list?
Thanks,
--
===================================================================
Sean Bright
elixer@erols.com / sean@seanbright.com / http://www.seanbright.com/
===================================================================