hi,

the main problem is that the (stupid) windows filesystem APIs consider
" foo", "foo " as being the same than "foo". It has caused all kind of
bad effects and we added checks in some areas already in 5.3.

Now that 5.4 has a "p" parameter we can simply cleanup the given paths
before passing it to the API.

I realized that unix does not raise a warning and simply check for the
actual path " foo" (in its full form), so this commit breaks the tests
on unix right now :P.

I will revert the tests change later today and go with another
solution, to escape the trailing spaces instead of rejecting them.
That should then behave the same way than on unix.

About:

CreateDirectoryW(L"\\\\?\\C:\\users\\gustavo.lopes\\ ",NULL);

It is a totally different thing as \\?\ paths are not treated the same
way by the underlying API (see msdn for the various path forms and how
they work, don't have the link at hand).

Cheers,

On Wed, Sep 7, 2011 at 3:28 PM, Gustavo Lopes <glo...@nebm.ist.utl.pt> wrote:
> Em Wed, 07 Sep 2011 13:41:45 +0100, Hannes Magnusson
> <hannes.magnus...@gmail.com> escreveu:
>
>> On Wed, Sep 7, 2011 at 14:33, Pierre Joye <paj...@php.net> wrote:
>>>
>>> pajoye                                   Wed, 07 Sep 2011 12:33:22 +0000
>>>
>>> Revision: http://svn.php.net/viewvc?view=revision&revision=316345
>>>
>>> Log:
>>> - reject paths with trainling spaces using the very good new zend arg
>>>
>>> Changed paths:
>>>   _U  php/php-src/branches/PHP_5_4/Zend/tests/bug52041.phpt
>>>   U   php/php-src/branches/PHP_5_4/Zend/zend_API.c
>>
>>
>> Windows can mount other filesystems that do allow folders to be called
>> " ". Please revert this.
>>
>
> You don't need other filesystems. I tried (where C: is a NTFS volume):
>
> CreateDirectoryW(L"\\\\?\\C:\\users\\gustavo.lopes\\ ",NULL);
>
> and it created a directory with " " as its name.
>
>
> --
> Gustavo Lopes
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to