Kaydet (Commit) 798fc82a authored tarafından Enrico Tröger's avatar Enrico Tröger

Fix project base_path detection if the path has a trailing slash.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4920 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 67249177
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
* src/prefs.c, src/project.c: * src/prefs.c, src/project.c:
win32.h can be included unconditionally. win32.h can be included unconditionally.
* src/sidebar.c:
Fix project base_path detection if the path has a trailing slash.
2010-05-15 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> 2010-05-15 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
......
...@@ -361,7 +361,11 @@ static GtkTreeIter *get_doc_parent(GeanyDocument *doc) ...@@ -361,7 +361,11 @@ static GtkTreeIter *get_doc_parent(GeanyDocument *doc)
/* check whether the dir name matches or uses the project base path */ /* check whether the dir name matches or uses the project base path */
if (!utils_str_equal(project_base_path, tmp_dirname)) if (!utils_str_equal(project_base_path, tmp_dirname))
setptr(project_base_path, g_strconcat(project_base_path, G_DIR_SEPARATOR_S, NULL)); {
const gchar *sep =
(project_base_path[len-1] == G_DIR_SEPARATOR) ? NULL : G_DIR_SEPARATOR_S;
setptr(project_base_path, g_strconcat(project_base_path, sep, NULL));
}
if (g_str_has_prefix(tmp_dirname, project_base_path)) if (g_str_has_prefix(tmp_dirname, project_base_path))
{ {
rest = tmp_dirname + len; rest = tmp_dirname + len;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment