From 064abaf9660d7c0b0242cc0dccf2d453311c7ae3 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Tue, 14 Mar 2006 16:47:02 +0000 Subject: [PATCH] path is NULL is an error here (gtk_file_system_get_info() already guards 2006-03-14 Kristian Rietveld * gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_info): path is NULL is an error here (gtk_file_system_get_info() already guards path = NULL), (gtk_file_system_unix_get_info): move basename creation to just before create_file_info(). (Federico Mena Quintero). --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ gtk/gtkfilesystemunix.c | 18 ++---------------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 00c293a85c..63e2ba3b83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-03-14 Kristian Rietveld + + * gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_info): path + is NULL is an error here (gtk_file_system_get_info() already guards + path = NULL), + (gtk_file_system_unix_get_info): move basename creation to just + before create_file_info(). (Federico Mena Quintero). + 2006-03-14 Kristian Rietveld * gtk/gtkfilesystemunix.c (struct _GtkFileFolderUnix): add diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 00c293a85c..63e2ba3b83 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2006-03-14 Kristian Rietveld + + * gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_info): path + is NULL is an error here (gtk_file_system_get_info() already guards + path = NULL), + (gtk_file_system_unix_get_info): move basename creation to just + before create_file_info(). (Federico Mena Quintero). + 2006-03-14 Kristian Rietveld * gtk/gtkfilesystemunix.c (struct _GtkFileFolderUnix): add diff --git a/gtk/gtkfilesystemunix.c b/gtk/gtkfilesystemunix.c index 9cc51a564c..f471abaaea 100644 --- a/gtk/gtkfilesystemunix.c +++ b/gtk/gtkfilesystemunix.c @@ -736,28 +736,12 @@ gtk_file_system_unix_get_info (GtkFileSystem *file_system, system_unix = GTK_FILE_SYSTEM_UNIX (file_system); handle = create_handle (file_system); - /* Get info for "/" */ - if (!path) - { - info = file_info_for_root_with_error ("/", &error); - - g_object_ref (handle); - queue_get_info_callback (callback, handle, info, error, data); - - return handle; - } - - /* Get info for normal files */ filename = gtk_file_path_get_string (path); g_return_val_if_fail (filename != NULL, FALSE); g_return_val_if_fail (g_path_is_absolute (filename), FALSE); - basename = g_path_get_basename (filename); - if (!stat_with_error (filename, &statbuf, &error)) { - g_free (basename); - g_object_ref (handle); queue_get_info_callback (callback, handle, NULL, error, data); return handle; @@ -768,6 +752,8 @@ gtk_file_system_unix_get_info (GtkFileSystem *file_system, else mime_type = NULL; + basename = g_path_get_basename (filename); + info = create_file_info (NULL, filename, basename, types, &statbuf, mime_type); g_free (basename);