[anjuta/gnome-2-26] 579118 – Segmentation fault when adding file to project



commit 2cf507ed38b7349096184edf0777907565c0a9da
Author: Johannes Schmid <jhs gnome org>
Date:   Sun Apr 19 23:28:04 2009 +0200

    579118 â?? Segmentation fault when adding file to project
    
    Applied patch from Nick Colgan fixing the segmentation fault by checking if the patch is absolute first.
---
 plugins/gbf-mkfile/gbf-mkfile-project.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/plugins/gbf-mkfile/gbf-mkfile-project.c b/plugins/gbf-mkfile/gbf-mkfile-project.c
index 93327e4..badfa2e 100644
--- a/plugins/gbf-mkfile/gbf-mkfile-project.c
+++ b/plugins/gbf-mkfile/gbf-mkfile-project.c
@@ -3237,8 +3237,13 @@ impl_add_source (GbfProject  *_project,
 	/* if the uri is relative, resolve it against the target's
 	 * group directory; we need to compute the group's uri
 	 * first */
-	group_uri = uri_normalize (g_path_skip_root (GBF_MKFILE_NODE (g_node->parent)->id),
-				   project->project_root_uri);
+        if (g_path_is_absolute (GBF_MKFILE_NODE (g_node->parent)->id)) {
+          group_uri = uri_normalize (g_path_skip_root (GBF_MKFILE_NODE (g_node->parent)->id),
+                                     project->project_root_uri);
+        } else {
+          group_uri = uri_normalize (GBF_MKFILE_NODE (g_node->parent)->id,
+                                                   project->project_root_uri);
+        }
 	full_uri = uri_normalize (uri, group_uri);
 	g_free (group_uri);
 	



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