[vlc-devel] [PATCH 16/41] Convert '/' to '\' on OS/2
KO Myung-Hun
komh78 at gmail.com
Fri Oct 14 16:23:23 CEST 2011
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];
>
>> + 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, '/').
>
>> +#endif
>> +
>> char *buf;
>> #if defined( WIN32 ) || defined( __OS2__ )
>> /* Drive letter */
>
Fixed.
--
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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0007-Convert-to-on-OS-2.patch
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20111014/4429d475/attachment.ksh>
More information about the vlc-devel
mailing list