From: Dirk Lemstra Date: Fri, 12 Apr 2019 20:24:33 +0000 (+0200) Subject: LOCALAPPDATA, APPDATA and USERPROFILE should only work on Windows. X-Git-Tag: 7.0.8-40~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dfb9ecb911c83b38ee743cc04dd472744baa96ff;p=imagemagick LOCALAPPDATA, APPDATA and USERPROFILE should only work on Windows. --- diff --git a/MagickCore/configure.c b/MagickCore/configure.c index 6d2b36d0c..3692d3257 100644 --- a/MagickCore/configure.c +++ b/MagickCore/configure.c @@ -875,12 +875,14 @@ MagickExport LinkedListInfo *GetConfigurePaths(const char *filename, *home; home=GetEnvironmentValue("XDG_CONFIG_HOME"); +#if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__MINGW32__) if (home == (char *) NULL) home=GetEnvironmentValue("LOCALAPPDATA"); if (home == (char *) NULL) home=GetEnvironmentValue("APPDATA"); if (home == (char *) NULL) home=GetEnvironmentValue("USERPROFILE"); +#endif if (home != (char *) NULL) { /* diff --git a/MagickCore/module.c b/MagickCore/module.c index 99985d74b..9c8a3c8f8 100644 --- a/MagickCore/module.c +++ b/MagickCore/module.c @@ -781,11 +781,13 @@ static MagickBooleanType GetMagickModulePath(const char *filename, home=GetEnvironmentValue("XDG_CONFIG_HOME"); if (home == (char *) NULL) +#if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__MINGW32__) home=GetEnvironmentValue("LOCALAPPDATA"); if (home == (char *) NULL) home=GetEnvironmentValue("APPDATA"); if (home == (char *) NULL) home=GetEnvironmentValue("USERPROFILE"); +#endif if (home != (char *) NULL) { /* diff --git a/MagickCore/opencl.c b/MagickCore/opencl.c index 9e65361bb..dd1b29ad6 100644 --- a/MagickCore/opencl.c +++ b/MagickCore/opencl.c @@ -298,12 +298,14 @@ static const char *GetOpenCLCacheDirectory() if (home == (char *) NULL) { home=GetEnvironmentValue("XDG_CACHE_HOME"); +#if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__MINGW32__) if (home == (char *) NULL) home=GetEnvironmentValue("LOCALAPPDATA"); if (home == (char *) NULL) home=GetEnvironmentValue("APPDATA"); if (home == (char *) NULL) home=GetEnvironmentValue("USERPROFILE"); +#endif } if (home != (char *) NULL)