diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-06 17:14:47 (EST) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-06 17:14:47 (EST) |
commit | 4522bfc2d2d2bce6f63f13991d6ceb3034d07779 (patch) | |
tree | ea49d0ea6607cc4afd63f41c7101a9bb4943c8d5 /src | |
parent | 6551d3af6f51b2a3d93b7db00d3f370e7e7633d3 (diff) | |
download | marquee-4522bfc2d2d2bce6f63f13991d6ceb3034d07779.zip marquee-4522bfc2d2d2bce6f63f13991d6ceb3034d07779.tar.gz marquee-4522bfc2d2d2bce6f63f13991d6ceb3034d07779.tar.bz2 |
mq_profiles_insert(): Fix directory creation
Wow that was stupid.
Diffstat (limited to 'src')
-rw-r--r-- | src/config/profiles.c | 6 |
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); |