]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/policy.c
Update web pages
[imagemagick] / MagickCore / policy.c
index 4dfd099fc938367330f4e40e28b541a2027f71f1..f3d1be3d1f6e00fa307dc1c2a0ccc77346543a33 100644 (file)
@@ -16,7 +16,7 @@
 %                                 July 1992                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2015 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -219,7 +219,7 @@ static LinkedListInfo *AcquirePolicyCache(const char *filename,
     policy_info->pattern=(char *) p->pattern;
     policy_info->value=(char *) p->value;
     policy_info->exempt=MagickTrue;
-    policy_info->signature=MagickSignature;
+    policy_info->signature=MagickCoreSignature;
     status&=AppendValueToLinkedList(policy_cache,policy_info);
     if (status == MagickFalse)
       (void) ThrowMagickException(exception,GetMagickModule(),
@@ -256,7 +256,7 @@ static LinkedListInfo *AcquirePolicyCache(const char *filename,
 static PolicyInfo *GetPolicyInfo(const char *name,ExceptionInfo *exception)
 {
   char
-    policyname[MaxTextExtent];
+    policyname[MagickPathExtent];
 
   register PolicyInfo
     *p;
@@ -272,12 +272,12 @@ static PolicyInfo *GetPolicyInfo(const char *name,ExceptionInfo *exception)
   */
   *policyname='\0';
   if (name != (const char *) NULL)
-    (void) CopyMagickString(policyname,name,MaxTextExtent);
+    (void) CopyMagickString(policyname,name,MagickPathExtent);
   for (q=policyname; *q != '\0'; q++)
   {
     if (isspace((int) ((unsigned char) *q)) == 0)
       continue;
-    (void) CopyMagickString(q,q+1,MaxTextExtent);
+    (void) CopyMagickString(q,q+1,MagickPathExtent);
     q--;
   }
   /*
@@ -736,18 +736,18 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
   ExceptionInfo *exception)
 {
   char
-    keyword[MaxTextExtent],
+    keyword[MagickPathExtent],
     *token;
 
-  PolicyInfo
-    *policy_info;
-
   const char
     *q;
 
-  MagickBooleanType
+  MagickStatusType
     status;
 
+  PolicyInfo
+    *policy_info;
+
   /*
     Load the policy map file.
   */
@@ -766,7 +766,7 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
     GetMagickToken(q,&q,token);
     if (*token == '\0')
       break;
-    (void) CopyMagickString(keyword,token,MaxTextExtent);
+    (void) CopyMagickString(keyword,token,MagickPathExtent);
     if (LocaleNCompare(keyword,"<!DOCTYPE",9) == 0)
       {
         /*
@@ -792,7 +792,7 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
         */
         while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
         {
-          (void) CopyMagickString(keyword,token,MaxTextExtent);
+          (void) CopyMagickString(keyword,token,MagickPathExtent);
           GetMagickToken(q,&q,token);
           if (*token != '=')
             continue;
@@ -805,17 +805,17 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
               else
                 {
                   char
-                    path[MaxTextExtent],
+                    path[MagickPathExtent],
                     *xml;
 
                   GetPathComponent(filename,HeadPath,path);
                   if (*path != '\0')
                     (void) ConcatenateMagickString(path,DirectorySeparator,
-                      MaxTextExtent);
+                      MagickPathExtent);
                   if (*token == *DirectorySeparator)
-                    (void) CopyMagickString(path,token,MaxTextExtent);
+                    (void) CopyMagickString(path,token,MagickPathExtent);
                   else
-                    (void) ConcatenateMagickString(path,token,MaxTextExtent);
+                    (void) ConcatenateMagickString(path,token,MagickPathExtent);
                   xml=FileToXML(path,~0UL);
                   if (xml != (char *) NULL)
                     {
@@ -839,7 +839,7 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
         (void) ResetMagickMemory(policy_info,0,sizeof(*policy_info));
         policy_info->path=ConstantString(filename);
         policy_info->exempt=MagickFalse;
-        policy_info->signature=MagickSignature;
+        policy_info->signature=MagickCoreSignature;
         continue;
       }
     if (policy_info == (PolicyInfo *) NULL)
@@ -928,7 +928,7 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
     }
   }
   token=(char *) RelinquishMagickMemory(token);
-  return(status);
+  return(status != 0 ? MagickTrue : MagickFalse);
 }
 \f
 /*
@@ -951,7 +951,8 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
 */
 MagickPrivate MagickBooleanType PolicyComponentGenesis(void)
 {
-  policy_semaphore=AcquireSemaphoreInfo();
+  if (policy_semaphore == (SemaphoreInfo *) NULL)
+    policy_semaphore=AcquireSemaphoreInfo();
   return(MagickTrue);
 }
 \f