[dconf/wip/reorg: 478/498] profile parser: handle newline characters properly



commit 3a17d73938fdaaed94ab7708cfbe94ec3aaf966e
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Jul 5 23:37:12 2012 -0400

    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".

 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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]