gtk/gtkfilechooserdefault.c (shortcuts_append_home,

2004-08-14  Tor Lillqvist  <tml@iki.fi>

	* gtk/gtkfilechooserdefault.c (shortcuts_append_home,
	shortcuts_append_desktop, set_local_only)
	* gtk/gtkfilesystemwin32.c (gtk_file_system_win32_render_icon)
	* gtk/gtkpathbar.c (find_button_type, _gtk_path_bar_set_file_system):
	Guard against g_get_home_dir() returning NULL. (#150007)
This commit is contained in:
Tor Lillqvist
2004-08-14 16:47:48 +00:00
committed by Tor Lillqvist
parent 15ed3634a9
commit ae6d3a2214
7 changed files with 70 additions and 10 deletions

View File

@ -1101,7 +1101,8 @@ gtk_file_system_win32_render_icon (GtkFileSystem *file_system,
}
else if (g_file_test (filename, G_FILE_TEST_IS_DIR))
{
if (0 == strcmp (g_get_home_dir(), filename))
const gchar *home = g_get_home_dir ();
if (home != NULL && 0 == strcmp (home, filename))
icon_set = gtk_style_lookup_icon_set (widget->style, GTK_STOCK_HOME);
else
icon_set = gtk_style_lookup_icon_set (widget->style, GTK_STOCK_DIRECTORY);