[MPlayer-dev-eng] [PATCH] gmplayer fsFileSelect related fixes
dalias at aerifal.cx
Mon Apr 9 12:51:39 CEST 2007
On Mon, Apr 09, 2007 at 11:11:26AM +0400, Sergey Pinaev wrote:
> On Mon, 9 Apr 2007 02:30:25 -0400
> Rich Felker <dalias at aerifal.cx> wrote:
> > On Mon, Apr 09, 2007 at 10:11:21AM +0400, Sergey Pinaev wrote:
> > > On Sun, 08 Apr 2007 22:52:05 +1100
> > > Vadim Pisarev <plv at farpost.com> wrote:
> > >
> > > > - gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)get_current_dir_name() );
> > > > + gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)g_filename_to_utf8(get_current_dir_name(), -1, NULL, NULL, NULL) );
> > >
> > > and who will free memory allocated by g_filename_to_utf8() ? Pushkin? =)
> > It uses a static buffer. It's intended only for immediate printing
> > like here, nothing else.
> gchar *
> g_locale_to_utf8 (const gchar *opsysstring,
Uhg sorry I misread the code and assumed it was using MPlayer's own
filename_to_utf8 functions (which it should perhaps do anyway...).
> > > (btw, afaiu get_current_dir_name() returns malloc()ed string, that should
> > > be free()d too)
> > If so then that should be fixed..
> get_current_dir_name, which is only prototyped if _GNU_SOURCE is
> defined, will malloc(3) an array big enough to hold the current direc-
> tory name.
Uhg, so this is some nasty glibcism? Replace it with something
portable then, like getcwd().
More information about the MPlayer-dev-eng