RE: [PHP-DEV] dirname() implementation question
| From: | Sean R. Bright | Date: | Sat, 28 Apr 2001 22:08:24 +0000 |
| Subject: | RE: [PHP-DEV] dirname() implementation question | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-52802@lists.php.net to get a copy of this message | ||
I don't want to rehash the entire discussion but what was the "reason" for
that? At first read I would assume something having to do with PATH_INFO
but after reflection I don't see how that would be too beneficial.
> -----Original Message-----
> From: Andi Gutmans [mailto:andi@zend.com]
> Sent: Saturday, April 28, 2001 5:02 PM
> To: elixer@erols.com; php-dev@lists.php.net
> Subject: Re: [PHP-DEV] dirname() implementation question
>
>
> At 02:42 PM 4/28/2001 -0400, Sean R. Bright wrote:
> >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?
>
> It was discussed already before.
> The semantics of the UNIX dirname is that it strips trailing slashes
> and the trailing word.
>
> Andi
>
>