From cba9793aac9fad2060a8cb5a7c9f4c395eb222b6 Mon Sep 17 00:00:00 2001
From: cristy <urban-warrior@git.imagemagick.org>
Date: Wed, 5 Mar 2014 22:52:17 +0000
Subject: [PATCH]

---
 MagickCore/opencl.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/MagickCore/opencl.c b/MagickCore/opencl.c
index 2cc056b6b..000f44cdf 100644
--- a/MagickCore/opencl.c
+++ b/MagickCore/opencl.c
@@ -2566,8 +2566,18 @@ const char* GetOpenCLCachedFilesDirectory() {
       if (home != (char *) NULL)
       {
         /*
-        Search $HOME/.config/ImageMagick.
+          Search $HOME/.config/ImageMagick.
         */
+        (void) FormatLocaleString(path,MaxTextExtent,"%s%s.config",home,
+          DirectorySeparator);
+        status=GetPathAttributes(path,&attributes);
+        if (status == MagickFalse) {
+#ifdef MAGICKCORE_WINDOWS_SUPPORT
+          mkdir(path);
+#else
+          mkdir(path, 0777);
+#endif
+        }
         (void) FormatLocaleString(path,MaxTextExtent,"%s%s.config%sImageMagick",
           home,DirectorySeparator,DirectorySeparator);
         home=DestroyString(home);
-- 
2.40.0