summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2012-07-05 23:37:12 -0400
committerRyan Lortie <desrt@desrt.ca>2012-07-06 00:19:44 -0400
commit3a17d73938fdaaed94ab7708cfbe94ec3aaf966e (patch)
treea5479ac3189b9fad07bdc374b8b7193c5cfc597b /engine
parent2b3f98e987b462c53b14655e63ba2c8ef894654c (diff)
downloaddconf-3a17d73938fdaaed94ab7708cfbe94ec3aaf966e.tar.gz
profile parser: handle newline characters properly
The profile parser wasn't chopping newlines from the configuration file which resulted in creation of filenames like "user\n".
Diffstat (limited to 'engine')
-rw-r--r--engine/dconf-engine-profile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/engine/dconf-engine-profile.c b/engine/dconf-engine-profile.c
index b1b73c0..896cd7c 100644
--- a/engine/dconf-engine-profile.c
+++ b/engine/dconf-engine-profile.c
@@ -61,7 +61,7 @@ dconf_engine_read_profile_file (FILE *file,
while (fgets (line, sizeof line, file))
{
DConfEngineSource *source;
- const gchar *end;
+ gchar *end;
end = strchr (line, '\n');
@@ -81,6 +81,8 @@ dconf_engine_read_profile_file (FILE *file,
if (line[0] == '#')
continue;
+ *end = '\0';
+
source = dconf_engine_source_new (line);
if (source != NULL)