[MPlayer-dev-eng] mplayer/trunk/gui/interface.c - fix gconvert_uri_to_filename

Guillaume Poirier gpoirier at mplayerhq.hu
Mon Aug 20 11:51:09 CEST 2007


Hi,

A C Hurst wrote:
> This patch fixes a crash in gconvert_uri_to_filename(), which occurs when URI's from drag and drop
> event contain escape characters.
> Also fixes a couple of memory leaks, and has my interpretation of the #ifdef USE_ICONV, falling
> back
> to return ISO8859-1 encoded filename if iconv() is unavailable.
> 
> iive is working on this bug, therfore I submit this purely as a comparison.
> 
> Comments / marks out of ten please :)
> 
> Andy
> 
> 
> ------------------------------------------------------------------------
> 
> --- mplayer-checkout-2007-08-18/gui/interface.c	2007-08-18 04:15:05.000000000 +0000
> +++ mplayer-checkout-modified/gui/interface.c	2007-08-19 20:47:31.000000000 +0000
> @@ -158,48 +158,76 @@
>   (*list)[i + 1] = NULL;
>  }
>  
> -#ifdef USE_ICONV
>  char * gconvert_uri_to_filename( char * str )
>  {
> - iconv_t   d;
> - char    * out = strdup( str );
> - char	 * tmp = NULL;
> - char    * ize;
> - size_t    inb,outb;
> - char    * charset = "ISO8859-1";
> - char    * cs;
> +   iconv_t   d;
> +   char    * out;
> +   char    * tmp = NULL;
> +   char    * retstr;
> +   char    * inbuf;
> +   char    * outbuf;
> +   size_t    inbytesleft, outbytesleft;
> +   char    * charset = "ISO8859-1";
> +   char    * cs;


these are cosmetics changes. Please don't mix cosmetic changes with
functionnal changes: it's hard to see what has really been changed
otherwise.

Guillaume



More information about the MPlayer-dev-eng mailing list