diff --git a/ChangeLog b/ChangeLog index eb4fe3a73..fd27361e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ underneath filetype templates in the New with Template menu. Add ui_menu_item_get_text(). Make utils_string_replace_all() ignore empty haystacks. + * src/templates.c: + Create ~/.geany/templates/files directory if it doesn't exist. 2008-05-12 Enrico Tröger diff --git a/src/templates.c b/src/templates.c index 4a9bcdfb0..31db8f952 100644 --- a/src/templates.c +++ b/src/templates.c @@ -435,13 +435,17 @@ static gboolean add_custom_template_items(void) gchar *path = g_build_path(G_DIR_SEPARATOR_S, app->configdir, GEANY_TEMPLATES_SUBDIR, "files", NULL); GSList *list = utils_get_file_list(path, NULL, NULL); - gboolean ret = list != NULL; + if (list == NULL) + { + utils_mkdir(path, FALSE); + return FALSE; + } g_slist_foreach(list, add_file_item, NULL); g_slist_foreach(list, (GFunc) g_free, NULL); g_slist_free(list); g_free(path); - return ret; + return TRUE; }