From: dirk Date: Wed, 26 Mar 2014 07:19:39 +0000 (+0000) Subject: Restored forward slashes for temp path. Ghostscript does not like backslashes. X-Git-Tag: 7.0.1-0~2543 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ee3d5618b6dd736e1fb8eab538f965c4365cab0;p=imagemagick Restored forward slashes for temp path. Ghostscript does not like backslashes. --- diff --git a/MagickCore/resource.c b/MagickCore/resource.c index d1d80f633..c61db77c3 100644 --- a/MagickCore/resource.c +++ b/MagickCore/resource.c @@ -357,6 +357,7 @@ MagickExport MagickBooleanType GetPathTemplate(char *path) { char *directory, + *p, *value; ExceptionInfo @@ -414,9 +415,19 @@ MagickExport MagickBooleanType GetPathTemplate(char *path) (void) FormatLocaleString(path,MaxTextExtent,"%smagick-%.20gXXXXXXXXXXXX", directory,(double) getpid()); else - (void) FormatLocaleString(path,MaxTextExtent,"%s%smagick-%.20gXXXXXXXXXXXX", - directory,DirectorySeparator,(double) getpid()); + (void) FormatLocaleString(path,MaxTextExtent, + "%s%smagick-%.20gXXXXXXXXXXXX",directory,DirectorySeparator, + (double) getpid()); directory=DestroyString(directory); +#if defined(MAGICKCORE_WINDOWS_SUPPORT) + /* + Ghostscript does not like backslashes so we need to replace them. The + forward slash also works under Windows. + */ + for (p=(path[1] == *DirectorySeparator ? path+2 : path); *p != '\0'; p++) + if (*p == *DirectorySeparator) + *p='/'; +#endif return(MagickTrue); }