From 7019896c99872b23d89b1404b02754cbc4ea1456 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 7 Oct 2012 16:09:35 -0400 Subject: [PATCH] Make FcInitDebug() idempotent --- src/fcdbg.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/fcdbg.c b/src/fcdbg.c index e8cbe32..270d791 100644 --- a/src/fcdbg.c +++ b/src/fcdbg.c @@ -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__