From: cristy Date: Mon, 17 Mar 2014 00:12:14 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~2570 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66f8c5f040cd0dc76d76e8e041764e2f799fae76;p=imagemagick --- diff --git a/MagickCore/delegate.c b/MagickCore/delegate.c index d83953a35..160a842de 100644 --- a/MagickCore/delegate.c +++ b/MagickCore/delegate.c @@ -171,12 +171,8 @@ static MagickBooleanType static LinkedListInfo *AcquireDelegateCache(const char *filename, ExceptionInfo *exception) { - const StringInfo - *option; - LinkedListInfo - *delegate_cache, - *options; + *delegate_cache; MagickStatusType status; @@ -185,17 +181,25 @@ static LinkedListInfo *AcquireDelegateCache(const char *filename, if (delegate_cache == (LinkedListInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); status=MagickTrue; - options=GetConfigureOptions(filename,exception); - option=(const StringInfo *) GetNextValueInLinkedList(options); #if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT) - while (option != (const StringInfo *) NULL) { - status&=LoadDelegateCache((const char *) GetStringInfoDatum(option), - GetStringInfoPath(option),0,exception); + const StringInfo + *option; + + LinkedListInfo + *options; + + options=GetConfigureOptions(filename,exception); option=(const StringInfo *) GetNextValueInLinkedList(options); + while (option != (const StringInfo *) NULL) + { + status&=LoadDelegateCache((const char *) GetStringInfoDatum(option), + GetStringInfoPath(option),0,exception); + option=(const StringInfo *) GetNextValueInLinkedList(options); + } + options=DestroyConfigureOptions(options); } #endif - options=DestroyConfigureOptions(options); if (IfMagickTrue(IsLinkedListEmpty(delegate_cache))) status&=LoadDelegateCache(DelegateMap,"built-in",0,exception); return(delegate_cache); diff --git a/MagickCore/locale.c b/MagickCore/locale.c index 3715cafc5..65557fdc5 100644 --- a/MagickCore/locale.c +++ b/MagickCore/locale.c @@ -189,12 +189,6 @@ static void *DestroyLocaleNode(void *locale_info) static SplayTreeInfo *AcquireLocaleSplayTree(const char *filename, const char *locale,ExceptionInfo *exception) { - const StringInfo - *option; - - LinkedListInfo - *options; - MagickStatusType status; @@ -206,30 +200,36 @@ static SplayTreeInfo *AcquireLocaleSplayTree(const char *filename, if (locale_cache == (SplayTreeInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); status=MagickTrue; - options=GetLocaleOptions(filename,exception); - option=(const StringInfo *) GetNextValueInLinkedList(options); #if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT) - while (option != (const StringInfo *) NULL) { - status&=LoadLocaleCache((const char *) GetStringInfoDatum(option), - GetStringInfoPath(option),locale,0,exception); + const StringInfo + *option; + + LinkedListInfo + *options; + + options=GetLocaleOptions(filename,exception); option=(const StringInfo *) GetNextValueInLinkedList(options); - } -#endif - options=DestroyLocaleOptions(options); -#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT) - if (GetNumberOfNodesInSplayTree(locale_cache) == 0) + while (option != (const StringInfo *) NULL) { - options=GetLocaleOptions("english.xml",exception); + status&=LoadLocaleCache((const char *) GetStringInfoDatum(option), + GetStringInfoPath(option),locale,0,exception); option=(const StringInfo *) GetNextValueInLinkedList(options); - while (option != (const StringInfo *) NULL) + } + options=DestroyLocaleOptions(options); + if (GetNumberOfNodesInSplayTree(locale_cache) == 0) { - status&=LoadLocaleCache((const char *) GetStringInfoDatum(option), - GetStringInfoPath(option),locale,0,exception); + options=GetLocaleOptions("english.xml",exception); option=(const StringInfo *) GetNextValueInLinkedList(options); + while (option != (const StringInfo *) NULL) + { + status&=LoadLocaleCache((const char *) GetStringInfoDatum(option), + GetStringInfoPath(option),locale,0,exception); + option=(const StringInfo *) GetNextValueInLinkedList(options); + } + options=DestroyLocaleOptions(options); } - options=DestroyLocaleOptions(options); - } + } #endif if (GetNumberOfNodesInSplayTree(locale_cache) == 0) status&=LoadLocaleCache(LocaleMap,"built-in",locale,0,exception); diff --git a/MagickCore/mime.c b/MagickCore/mime.c index ada6eb778..981ede4c6 100644 --- a/MagickCore/mime.c +++ b/MagickCore/mime.c @@ -156,15 +156,8 @@ static MagickBooleanType MagickExport LinkedListInfo *AcquireMimeCache(const char *filename, ExceptionInfo *exception) { -#if defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT) - return(LoadMimeCache(MimeMap,"built-in",0,exception)); -#else - const StringInfo - *option; - LinkedListInfo - *mime_cache, - *options; + *mime_cache; MagickStatusType status; @@ -173,22 +166,28 @@ MagickExport LinkedListInfo *AcquireMimeCache(const char *filename, if (mime_cache == (LinkedListInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); status=MagickTrue; - options=GetConfigureOptions(filename,exception); - option=(const StringInfo *) GetNextValueInLinkedList(options); - while (option != (const StringInfo *) NULL) +#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT) { - status&=LoadMimeCache((const char *) GetStringInfoDatum(option), - GetStringInfoPath(option),0,exception); + const StringInfo + *option; + + LinkedListInfo + *options; + + options=GetConfigureOptions(filename,exception); option=(const StringInfo *) GetNextValueInLinkedList(options); + while (option != (const StringInfo *) NULL) + { + status&=LoadMimeCache((const char *) GetStringInfoDatum(option), + GetStringInfoPath(option),0,exception); + option=(const StringInfo *) GetNextValueInLinkedList(options); + } + options=DestroyConfigureOptions(options); } - options=DestroyConfigureOptions(options); - if ((mime_cache == (LinkedListInfo *) NULL) || - (IsLinkedListEmpty(mime_cache) != MagickFalse)) +#endif + if (IsLinkedListEmpty(mime_cache) != MagickFalse) status&=LoadMimeCache(MimeMap,"built-in",0,exception); - else - ClearMagickException(exception); return(mime_cache); -#endif } /* diff --git a/MagickCore/type.c b/MagickCore/type.c index b51c3670d..73a71f688 100644 --- a/MagickCore/type.c +++ b/MagickCore/type.c @@ -184,16 +184,6 @@ static void *DestroyTypeNode(void *type_info) static SplayTreeInfo *AcquireTypeCache(const char *filename, ExceptionInfo *exception) { - char - *font_path, - path[MaxTextExtent]; - - const StringInfo - *option; - - LinkedListInfo - *options; - MagickStatusType status; @@ -205,39 +195,49 @@ static SplayTreeInfo *AcquireTypeCache(const char *filename, if (type_cache == (SplayTreeInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); status=MagickTrue; - *path='\0'; - options=GetConfigureOptions(filename,exception); - option=(const StringInfo *) GetNextValueInLinkedList(options); #if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT) - while (option != (const StringInfo *) NULL) { - (void) CopyMagickString(path,GetStringInfoPath(option),MaxTextExtent); - status&=LoadTypeCache((const char *) GetStringInfoDatum(option), - GetStringInfoPath(option),0,exception); + char + *font_path, + path[MaxTextExtent]; + + const StringInfo + *option; + + LinkedListInfo + *options; + + *path='\0'; + options=GetConfigureOptions(filename,exception); option=(const StringInfo *) GetNextValueInLinkedList(options); - } -#endif - options=DestroyConfigureOptions(options); - font_path=GetEnvironmentValue("MAGICK_FONT_PATH"); -#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT) - if (font_path != (char *) NULL) + while (option != (const StringInfo *) NULL) { - char - *option; - - /* - Search MAGICK_FONT_PATH. - */ - (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",font_path, - DirectorySeparator,filename); - option=FileToString(path,~0UL,exception); - if (option != (void *) NULL) - { - status&=LoadTypeCache(option,path,0,exception); - option=DestroyString(option); - } - font_path=DestroyString(font_path); + (void) CopyMagickString(path,GetStringInfoPath(option),MaxTextExtent); + status&=LoadTypeCache((const char *) GetStringInfoDatum(option), + GetStringInfoPath(option),0,exception); + option=(const StringInfo *) GetNextValueInLinkedList(options); } + options=DestroyConfigureOptions(options); + font_path=GetEnvironmentValue("MAGICK_FONT_PATH"); + if (font_path != (char *) NULL) + { + char + *option; + + /* + Search MAGICK_FONT_PATH. + */ + (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",font_path, + DirectorySeparator,filename); + option=FileToString(path,~0UL,exception); + if (option != (void *) NULL) + { + status&=LoadTypeCache(option,path,0,exception); + option=DestroyString(option); + } + font_path=DestroyString(font_path); + } + } #endif if (GetNumberOfNodesInSplayTree(type_cache) == 0) status&=LoadTypeCache(TypeMap,"built-in",0,exception);