Make FcInitDebug() idempotent
authorBehdad Esfahbod <behdad@behdad.org>
Sun, 7 Oct 2012 20:09:35 +0000 (16:09 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 2 Jan 2013 06:53:16 +0000 (00:53 -0600)
src/fcdbg.c

index e8cbe32..270d791 100644 (file)
@@ -455,15 +455,17 @@ int FcDebugVal;
 void
 FcInitDebug (void)
 {
-    char    *e;
+    if (!FcDebugVal) {
+       char    *e;
 
-    e = getenv ("FC_DEBUG");
-    if (e)
-    {
-        printf ("FC_DEBUG=%s\n", e);
-        FcDebugVal = atoi (e);
-        if (FcDebugVal < 0)
-           FcDebugVal = 0;
+       e = getenv ("FC_DEBUG");
+       if (e)
+       {
+           printf ("FC_DEBUG=%s\n", e);
+           FcDebugVal = atoi (e);
+           if (FcDebugVal < 0)
+               FcDebugVal = 0;
+       }
     }
 }
 #define __fcdbg__