[vlc-devel] [PATCH] vlc: Convert command line arguments to UTF-8 on OS/2

KO Myung-Hun komh78 at gmail.com
Tue Oct 16 14:13:32 CEST 2012



KO Myung-Hun wrote:
> ---
>  bin/vlc.c |   18 ++++++++++++++++++
>  1 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/bin/vlc.c b/bin/vlc.c
> index 9151633..2015235 100644
> --- a/bin/vlc.c
> +++ b/bin/vlc.c
> @@ -42,6 +42,9 @@
>  #include <unistd.h>
>  
>  #ifdef __OS2__
> +# include <vlc_common.h>
> +# include <vlc_charset.h>
> +
>  # define pthread_t      int
>  # define pthread_self() _gettid()
>  #endif
> @@ -183,8 +186,18 @@ int main( int i_argc, const char *ppsz_argv[] )
>      if (i_argc >= 1 && !strncmp (*ppsz_argv, "-psn" , 4))
>          ppsz_argv++, i_argc--;
>  #endif
> +#ifdef __OS2__
> +    for (int i = 0; i < i_argc; i++)
> +        if ((argv[argc++] = FromLocaleDup (ppsz_argv[i])) == NULL)
> +        {
> +            fprintf (stderr, "Converting '%s' to UTF-8 failed.\n",
> +                     ppsz_argv[i]);
> +            return 1;
> +        }
> +#else
>      memcpy (argv + argc, ppsz_argv, i_argc * sizeof (*argv));
>      argc += i_argc;
> +#endif
>      argv[argc] = NULL;
>  
>      vlc_enable_override ();
> @@ -237,5 +250,10 @@ out:
>      if (vlc != NULL)
>          libvlc_release (vlc);
>  
> +#ifdef __OS2__
> +    for (int i = 2; i < argc; i++)
> +        free (argv[i]);
> +#endif
> +
>      return 0;
>  }

Ping ?

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v4.1.18 on Intel Core i7-3615QM 2.30GHz with 8GB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr




More information about the vlc-devel mailing list