All pastes #614016 Raw Edit

Etwas

public text v1 · immutable
·published 2007-07-11 09:18 UTC
rendered paste body
diff --git a/src/config.c b/src/config.c
index c162fde..00c23a4 100644
--- a/src/config.c
+++ b/src/config.c
@@ -113,17 +113,21 @@ ccsReadGlobalConfig (ConfigOption option,
     Bool          ret;
     FILE          *fp;
 
+    printf("reading from global config file %s\n", SYSCONFDIR "/compizconfig/config");
     /* 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");
+    printf("file open returned %p\n", fp);
     if (!fp)
 	return FALSE;
     fclose (fp);
 
     iniFile = ccsIniOpen (SYSCONFDIR "/compizconfig/config");
+    printf("global ini is %p\n", iniFile);
     if (!iniFile)
 	return FALSE;
 
+    printf("got global config file\n");
     switch (option)
     {
     case OptionProfile:
@@ -147,6 +151,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 +169,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 +197,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 +223,7 @@ ccsWriteConfig (ConfigOption option,
     if (ccsReadConfig (option, &curVal) && strcmp (value, curVal) == 0)
 	return TRUE;
 
-    iniFile = getConfigFile();
+    iniFile = getConfigFile ();
     if (!iniFile)
 	return FALSE;
 
@@ -241,6 +249,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);