diff options
author | Ryan Lortie <desrt@desrt.ca> | 2012-07-05 23:37:12 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2012-07-06 00:19:44 -0400 |
commit | 3a17d73938fdaaed94ab7708cfbe94ec3aaf966e (patch) | |
tree | a5479ac3189b9fad07bdc374b8b7193c5cfc597b /engine | |
parent | 2b3f98e987b462c53b14655e63ba2c8ef894654c (diff) | |
download | dconf-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.c | 4 |
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) |