[MPlayer-dev-eng] [PATCH] Allow double quote to be defined in font file

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Dec 19 21:49:48 CET 2010


On Sun, Dec 19, 2010 at 09:12:26PM +0100, Ingo Brueckl wrote:
> +  locale = setlocale(LC_ALL, "");
> +  filename = g_filename_to_utf8(fname, -1, NULL, NULL, NULL);
> +  setlocale(LC_ALL, locale);

You could extract that into a wrapper function, that's duplicated
a lot of time.
Also, does restoring the old locale this way actually work?
LC_ALL modifies multiple locale settings, do they all get
restored correctly (e.g. if you have if LC_CTYPE="tr" and
LC_NUMERIC="en" at the start, would they again have different
locale settings at the end?).

> + char *locale;

const char * would be more appropriate.

> -  str[1] = fname;
> +  str[1] = filename;
>    pos = gtk_clist_append(GTK_CLIST(list), str);
>    gtk_clist_set_pixmap(GTK_CLIST(list), pos, 0, pixmap, mask);
> +  g_free(filename);


> +     text[0][0]=name;
> +     text[0][1]=path;
>       gtk_clist_append( GTK_CLIST( CLSelected ),text[0] );
> +     g_free(path);
> +     g_free(name);

> +	    text[0][0]=itext[0][0]; text[0][1]=cpath;
>  	    gtk_clist_append( GTK_CLIST( CLSelected ),text[0] );
> +	    g_free(cpath);

Are you sure that gtk_clist_append makes a copy if the string?
The documentation I could find for it is unfortunately useless.

> +  if (name) g_free(name);

No need for the if btw.


More information about the MPlayer-dev-eng mailing list