Re: [RFC PATCH 5/6] msvc: opendir: handle paths ending with a slash
On Tue, Nov 23, 2010 at 6:43 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 13 quoted lines
> Erik Faye-Lund wrote:
>
>> --- a/compat/msvc.c
>> +++ b/compat/msvc.c
>> @@ -23,6 +23,8 @@ DIR *opendir(const char *name)
>>
>> /* check that the pattern won't be too long for FindFirstFileA */
>> len = strlen(name);
>> + if (is_dir_sep(name[len - 1]))
>> + len--;
>
> I assume len can't be 0?
>
Nope, in that case GetFileAttributesA would have errore out.