]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/44
authorCristy <urban-warrior@imagemagick.org>
Sun, 4 Oct 2015 23:44:36 +0000 (19:44 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 4 Oct 2015 23:44:36 +0000 (19:44 -0400)
MagickCore/configure.c
MagickCore/module.c
MagickCore/opencl.c

index f4596a461086722845ee6b9293ae59b8b6d621ac..8fa7728bf5589bb3e2b0665e4fdf09dc53a6adcf 100755 (executable)
@@ -812,8 +812,8 @@ MagickExport LinkedListInfo *GetConfigurePaths(const char *filename,
     key_value=NTRegistryKeyLookup(RegistryKey);
     if (key_value != (unsigned char *) NULL)
       {
-        (void) FormatLocaleString(path,MagickPathExtent,"%s%s",(char *) key_value,
-          DirectorySeparator);
+        (void) FormatLocaleString(path,MagickPathExtent,"%s%s",(char *)
+          key_value,DirectorySeparator);
         (void) AppendValueToLinkedList(paths,ConstantString(path));
         key_value=(unsigned char *) RelinquishMagickMemory(key_value);
       }
@@ -883,6 +883,17 @@ MagickExport LinkedListInfo *GetConfigurePaths(const char *filename,
     char
       *home;
 
+    home=GetEnvironmentValue("XDG_CONFIG_HOME");
+    if (home != (char *) NULL)
+      { 
+        /*
+          Search $XDG_CONFIG_HOME/ImageMagick.
+        */
+        (void) FormatLocaleString(path,MaxTextExtent,"%s%sImageMagick%s%s",
+          home,DirectorySeparator,DirectorySeparator,filename);
+        (void) AppendValueToLinkedList(paths,ConstantString(path));
+        home=DestroyString(home);
+      }
     home=GetEnvironmentValue("HOME");
     if (home == (char *) NULL)
       home=GetEnvironmentValue("USERPROFILE");
index 1c114ec2aa2eb7ebf14bf454af19b4722af62fcd..e94a8061664e94863ecb1452ef9822eace10c4e1 100644 (file)
@@ -768,7 +768,8 @@ static MagickBooleanType GetMagickModulePath(const char *filename,
     if ((NTGetModulePath("CORE_RL_MagickCore_.dll",path) != MagickFalse) ||
         (NTGetModulePath("CORE_DB_MagickCore_.dll",path) != MagickFalse))
       {
-        (void) ConcatenateMagickString(path,DirectorySeparator,MagickPathExtent);
+        (void) ConcatenateMagickString(path,DirectorySeparator,
+          MagickPathExtent);
         (void) ConcatenateMagickString(path,filename,MagickPathExtent);
         if (IsPathAccessible(path) != MagickFalse)
           return(MagickTrue);
@@ -779,6 +780,18 @@ static MagickBooleanType GetMagickModulePath(const char *filename,
     char
       *home;
 
+    home=GetEnvironmentValue("XDG_CONFIG_HOME");
+    if (home != (char *) NULL)
+      { 
+        /*
+          Search $XDG_CONFIG_HOME/ImageMagick.
+        */
+        (void) FormatLocaleString(path,MaxTextExtent,"%s%sImageMagick%s%s",
+          home,DirectorySeparator,DirectorySeparator,filename);
+        home=DestroyString(home);
+        if (IsPathAccessible(path) != MagickFalse)
+          return(MagickTrue);
+      }
     home=GetEnvironmentValue("HOME");
     if (home == (char *) NULL)
       home=GetEnvironmentValue("USERPROFILE");
index 1a1fd19d986b87763b5d00ec365820e32c7b2614..e1f750f96158b7a4e4d72db2d33e674a10f0f71a 100644 (file)
@@ -2841,8 +2841,8 @@ const char* GetOpenCLCachedFilesDirectory() {
         /*
         */
 
-        /* first check if $HOME/.config exists */
-        (void) FormatLocaleString(path,MagickPathExtent,"%s%s.config",
+        /* first check if $HOME/.cache exists */
+        (void) FormatLocaleString(path,MagickPathExtent,"%s%s.cache",
           home,DirectorySeparator);
         status=GetPathAttributes(path,&attributes);
         if (status == MagickFalse) 
@@ -2855,11 +2855,12 @@ const char* GetOpenCLCachedFilesDirectory() {
 #endif
         }
         
-        /* first check if $HOME/.config/ImageMagick exists */
+        /* first check if $HOME/.cache/ImageMagick exists */
         if (mkdirStatus==0) 
         {
-            (void) FormatLocaleString(path,MagickPathExtent,"%s%s.config%sImageMagick",
-              home,DirectorySeparator,DirectorySeparator);
+            (void) FormatLocaleString(path,MagickPathExtent,
+              "%s%s.cache%sImageMagick",home,DirectorySeparator,
+              DirectorySeparator);
                     
             status=GetPathAttributes(path,&attributes);
             if (status == MagickFalse)