summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/config/profiles.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/config/profiles.c b/src/config/profiles.c
index 8ee8acb..040f87c 100644
--- a/src/config/profiles.c
+++ b/src/config/profiles.c
@@ -208,6 +208,7 @@ gchar *
mq_profiles_insert(MqProfiles *profiles, const gchar *name, const gchar *color)
{
gchar *id;
+ gchar *dir;
/* The ID must be safe for both the file system and HTML5 "name" and
* "id" attributes. To make profile directories portable to other file
@@ -220,10 +221,13 @@ mq_profiles_insert(MqProfiles *profiles, const gchar *name, const gchar *color)
/* Make sure the profile directory can be created and doesn't already
* exist (or, on a case-insensitive file system, a directory by the same
* name but in a different case doesn't exist). */
- if (g_mkdir(profiles->config_dir, 0700) != 0) {
+ dir = g_build_filename(profiles->config_dir, id, NULL);
+ if (g_mkdir(dir, 0700) != 0) {
g_free(id);
+ g_free(dir);
return NULL;
}
+ g_free(dir);
mq_profiles_set_name(profiles, id, name);
mq_profiles_set_color(profiles, id, color);