From a28220c00bbbc53f52ce8c1e7d2384837a466838 Mon Sep 17 00:00:00 2001 From: Philip Chimento <philip.chimento@gmail.com> Date: Tue, 3 Dec 2013 18:51:51 -0800 Subject: [PATCH] gfile: Use g_error_matches Make proper use of g_error_matches() instead of comparing only error codes. https://bugzilla.gnome.org/show_bug.cgi?id=719455 --- gio/gfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gio/gfile.c b/gio/gfile.c index b40e46a..2065111 100644 --- a/gio/gfile.c +++ b/gio/gfile.c @@ -3752,7 +3752,7 @@ g_file_make_directory_with_parents (GFile *file, return FALSE; g_file_make_directory (file, cancellable, &my_error); - if (my_error == NULL || my_error->code != G_IO_ERROR_NOT_FOUND) + if (!g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) { if (my_error) g_propagate_error (error, my_error); @@ -3761,7 +3761,7 @@ g_file_make_directory_with_parents (GFile *file, work_file = g_object_ref (file); - while (my_error != NULL && my_error->code == G_IO_ERROR_NOT_FOUND) + while (g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) { GFile *parent_file; @@ -3780,7 +3780,7 @@ g_file_make_directory_with_parents (GFile *file, g_object_unref (work_file); work_file = g_object_ref (parent_file); - if (my_error != NULL && my_error->code == G_IO_ERROR_NOT_FOUND) + if (g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) list = g_list_prepend (list, parent_file); /* Transfer ownership of ref */ else g_object_unref (parent_file); -- 2.3.2