[vlc-devel] [PATCH 16/41] Convert '/' to '\' on OS/2
KO Myung-Hun
komh78 at gmail.com
Mon Oct 10 17:12:54 CEST 2011
Hi/2.
Rémi Denis-Courmont wrote:
> On Mon, 10 Oct 2011 20:43:55 +0900, KO Myung-Hun <komh at chollian.net>
> wrote:
>> This allows a mixed usage of '\' and '/'.
>> ---
>> src/text/strings.c | 10 ++++++++++
>> 1 files changed, 10 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/text/strings.c b/src/text/strings.c
>> index d5cae97..93ae149 100644
>> --- a/src/text/strings.c
>> +++ b/src/text/strings.c
>> @@ -1074,6 +1074,16 @@ char *make_URI (const char *path, const char
>> *scheme)
>> /* Note: VLC cannot handle URI schemes without double slash after
> the
>> * scheme name (such as mailto: or news:). */
>>
>> +#ifdef __OS2__
>> + char *p = alloca (strlen (path) + 1);
>
> Since VLC uses C99, you could avoid the non-standard alloca():
>
> char p[strlen (path) + 1];
>
Ah, thanks.
>> + strcpy (p, path);
>> + path = p;
>> +
>> + for (; *p; p++)
>> + if (*p == '/')
>> + *p = DIR_SEP_CHAR;
>
> You could probably fold the copy into the loop. Alternatively, you could
> use strchr(p, '/').
>
Ok, I'll try.
>> +#endif
>> +
>> char *buf;
>> #if defined( WIN32 ) || defined( __OS2__ )
>> /* Drive letter */
>
--
KO Myung-Hun
Using Mozilla SeaMonkey 2.0.14
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1GHz with 512 MB RAM
Korean OS/2 User Community : http://www.ecomstation.co.kr
More information about the vlc-devel
mailing list