[vlc-devel] [PATCH] ftp: fix directory listing with legacy server

Felix Paul Kühne fkuehne at videolan.org
Thu May 21 10:40:35 CEST 2020


Hello Rémi,

Thanks for your review.

> On 20. May 2020, at 17:50, Rémi Denis-Courmont <remi at remlab.net> wrote:
> 
> Le keskiviikkona 20. toukokuuta 2020, 16.21.46 EEST Felix Paul Kühne a écrit :
>> From: Felix Paul Kühne <felix at feepk.net>
>> 
>> A legacy ftp server included in macOS 10.6 and earlier tried to be clever
>> and gives the keys as Uppercase so VLC failed to determine the item type.
> 
> The existing code does not look right and this patch makes it marginally worse 
> as strcasestr() is locale-dependent.

It is true that the current code is rather pragmatic but it does the job well.

Regarding locale-dependency, you are definitely right. I’m wondering though whether there is a real-life impact as the issue that needs to be mitigated is treating “Type=dir” and “type=dir” as the same string.
I could also offer to use strcasestr_l() with en_US but I’m not sure whether the runtime behavior even on Arabic or Asian systems would be any different compared to using strcasestr().

Best regards,

Felix


More information about the vlc-devel mailing list