Commit 6da22af9 authored by Behdad Esfahbod's avatar Behdad Esfahbod Committed by Behdad Esfahbod
Browse files

Use a GString instead of static buffer to reduce .bss by 8kb. (#336784)

2006-04-01  Behdad Esfahbod  <behdad@gnome.org>

        * gtk/gtkfilesel.c (gtk_file_selection_get_filename): Use a GString
        instead of static buffer to reduce .bss by 8kb. (#336784)
parent 68d222c7
2006-04-01 Behdad Esfahbod <behdad@gnome.org>
* gtk/gtkfilesel.c (gtk_file_selection_get_filename): Use a GString
instead of static buffer to reduce .bss by 8kb. (#336784)
2006-04-01 Dom Lachowicz <cinamod@hotmail.com>
* modules/engines/ms-windows/msw_style.c (draw_hline): Emulate WinXP's
......
2006-04-01 Behdad Esfahbod <behdad@gnome.org>
* gtk/gtkfilesel.c (gtk_file_selection_get_filename): Use a GString
instead of static buffer to reduce .bss by 8kb. (#336784)
2006-04-01 Dom Lachowicz <cinamod@hotmail.com>
* modules/engines/ms-windows/msw_style.c (draw_hline): Emulate WinXP's
......
......@@ -1243,7 +1243,7 @@ G_CONST_RETURN gchar*
gtk_file_selection_get_filename (GtkFileSelection *filesel)
{
static const gchar nothing[2] = "";
static gchar something[MAXPATHLEN*2+1];
static GString *something;
char *sys_filename;
const char *text;
......@@ -1260,10 +1260,14 @@ gtk_file_selection_get_filename (GtkFileSelection *filesel)
g_free (fullname);
if (!sys_filename)
return nothing;
if (!something)
something = g_string_new (sys_filename);
else
g_string_assign (something, sys_filename);
strncpy (something, sys_filename, sizeof (something) - 1);
something[sizeof (something) - 1] = '\0';
g_free (sys_filename);
return something;
return something->str;
}
return nothing;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment