From ae48f17999bd3262642f13127c9b1ac3befabd06 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sun, 31 Aug 2008 16:01:02 +0000 Subject: [PATCH] Don't lose if we have no includedirs * girepository/girparser.c: Don't lose if we have no includedirs svn path=/trunk/; revision=551 --- girparser.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/girparser.c b/girparser.c index 267092c33..b7ad408f1 100644 --- a/girparser.c +++ b/girparser.c @@ -148,13 +148,16 @@ locate_gir (const char *name, const char * const* extra_paths) g_free (path); path = NULL; } - for (dir = extra_paths; *dir; dir++) + if (extra_paths != NULL) { - path = g_build_filename (*dir, girname, NULL); - if (g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) - return path; - g_free (path); - path = NULL; + for (dir = extra_paths; *dir; dir++) + { + path = g_build_filename (*dir, girname, NULL); + if (g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) + return path; + g_free (path); + path = NULL; + } } g_free (girname); return path;