All pastes #614012 Raw Edit

Vermischtes

public text v1 · immutable
·published 2007-07-11 09:12 UTC
rendered paste body
diff --git a/src/config.c b/src/config.c
index c162fde..d569b2e 100644
--- a/src/config.c
+++ b/src/config.c
@@ -113,6 +113,7 @@ ccsReadGlobalConfig (ConfigOption option,
     Bool          ret;
     FILE          *fp;
 
+    printf("reading from global config\n");
     /* check if the global config file exists - if it doesn't, exit
        to avoid it being created by ccsIniOpen */
     fp = fopen (SYSCONFDIR "/compizconfig/config", "r");
@@ -124,6 +125,7 @@ ccsReadGlobalConfig (ConfigOption option,
     if (!iniFile)
 	return FALSE;
 
+    printf("got global config file\n");
     switch (option)
     {
     case OptionProfile:
@@ -147,6 +149,7 @@ ccsReadGlobalConfig (ConfigOption option,
 
     *value = NULL;
     section = getSectionName();
+    printf("reading from global section %s\n", section);
     ret = ccsIniGetString (iniFile, section, entry, value);
     free (section);
     ccsIniClose (iniFile);
@@ -164,7 +167,8 @@ ccsReadConfig (ConfigOption option,
     char          *section;
     Bool          ret;
 
-    iniFile = getConfigFile();
+    iniFile = getConfigFile ();
+    printf("opening local config returned %p\n", iniFile);
     if (!iniFile)
 	return ccsReadGlobalConfig (option, value);
 
@@ -191,7 +195,9 @@ ccsReadConfig (ConfigOption option,
 
     *value = NULL;
     section = getSectionName();
+    printf("reading local section %s\n", section);
     ret = ccsIniGetString (iniFile, section, entry, value);
+    printf("reading local entry %s returned %d\n", ret);
     free (section);
     ccsIniClose (iniFile);
 
@@ -215,7 +221,7 @@ ccsWriteConfig (ConfigOption option,
     if (ccsReadConfig (option, &curVal) && strcmp (value, curVal) == 0)
 	return TRUE;
 
-    iniFile = getConfigFile();
+    iniFile = getConfigFile ();
     if (!iniFile)
 	return FALSE;
 
@@ -241,6 +247,7 @@ ccsWriteConfig (ConfigOption option,
     }
 
     section = getSectionName();
+    printf("writing %s to entry %s in section %s of local file\n", value, entry, section);
     ccsIniSetString (iniFile, section, entry, value);
     free (section);