Fix showing project name in sidebar documents

This was broken if the base path ended with a directory separator.
This commit is contained in:
Nick Treleaven 2012-07-06 13:17:54 +01:00
parent 74959b9cb9
commit 5af4dab5f0

View File

@ -368,8 +368,9 @@ static gchar *get_doc_folder(const gchar *path)
{
gsize len = strlen(project_base_path);
/* remove trailing separator so we can match base path exactly */
if (project_base_path[len-1] == G_DIR_SEPARATOR)
project_base_path[len-1] = '\0';
project_base_path[--len] = '\0';
/* check whether the dir name matches or uses the project base path */
if (utils_filename_has_prefix(tmp_dirname, project_base_path))