[gnome-builder] makecache: check for valid subdir before calling g_str_has_prefix()



commit 8b188ae7c7b0798ecc22041e4ac4baddc4353aa6
Author: Christian Hergert <christian hergert me>
Date:   Wed Mar 25 14:24:33 2015 -0700

    makecache: check for valid subdir before calling g_str_has_prefix()

 libide/autotools/ide-makecache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libide/autotools/ide-makecache.c b/libide/autotools/ide-makecache.c
index e155c32..d917299 100644
--- a/libide/autotools/ide-makecache.c
+++ b/libide/autotools/ide-makecache.c
@@ -847,7 +847,7 @@ ide_makecache_get_file_flags_worker (GTask        *task,
 
       cwd = g_file_get_path (self->parent);
 
-      if (g_str_has_prefix (lookup->relative_path, subdir))
+      if ((subdir != NULL) && g_str_has_prefix (lookup->relative_path, subdir))
         relpath = lookup->relative_path + strlen (subdir);
       else
         relpath = lookup->relative_path;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]