/*
- * $XFree86: $
+ * $XFree86: xc/lib/fontconfig/src/fccfg.c,v 1.3 2002/02/19 08:33:23 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
#include <stdio.h>
#include "fcint.h"
-static FcConfig *fcConfig;
+FcConfig *_fcConfig;
FcConfig *
FcConfigCreate (void)
if (!FcConfigBuildFonts (config))
return FcFalse;
- if (fcConfig)
- FcConfigDestroy (fcConfig);
- fcConfig = config;
+ if (_fcConfig)
+ FcConfigDestroy (_fcConfig);
+ _fcConfig = config;
return FcTrue;
}
FcConfig *
FcConfigGetCurrent (void)
{
- return fcConfig;
+ if (!_fcConfig)
+ if (!FcInit ())
+ return 0;
+ return _fcConfig;
}
FcBool
l->value = FcConfigEvaluate (p, e);
l->next = 0;
}
- while (l->value.type == FcTypeVoid)
+ while (l && l->value.type == FcTypeVoid)
{
FcValueList *next = l->next;