[glib] g_file_make_directory_with_parents(): fix a corner case
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] g_file_make_directory_with_parents(): fix a corner case
- Date: Thu, 16 Aug 2012 22:10:49 +0000 (UTC)
commit 5291190f46614c9e1491599af345f9c41c74967e
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Tue Aug 14 11:20:16 2012 -0400
g_file_make_directory_with_parents(): fix a corner case
If g_file_get_parent() unexpectedly failed, we could return
FALSE but with no error.
https://bugzilla.gnome.org/show_bug.cgi?id=680823
gio/gfile.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gio/gfile.c b/gio/gfile.c
index 68207ac..92776af 100644
--- a/gio/gfile.c
+++ b/gio/gfile.c
@@ -3384,11 +3384,12 @@ g_file_make_directory_with_parents (GFile *file,
{
GFile *parent_file;
- g_clear_error (&my_error);
-
parent_file = g_file_get_parent (work_file);
if (parent_file == NULL)
break;
+
+ g_clear_error (&my_error);
+
result = g_file_make_directory (parent_file, cancellable, &my_error);
g_object_unref (work_file);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]