]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 29 Aug 2011 16:53:16 +0000 (16:53 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 29 Aug 2011 16:53:16 +0000 (16:53 +0000)
MagickCore/display.c

index f1d9f0e388ea19b20af71e11d1a7064fc915a7c9..1c93b078d35dc4976c60b0439fef52d8716eee0f 100644 (file)
@@ -12509,10 +12509,13 @@ static MagickBooleanType XSaveImage(Display *display,
 
       GetPathComponent(image->filename,HeadPath,path);
       GetPathComponent(image->filename,TailPath,filename);
-      status=chdir(path);
-      if (status == -1)
-        (void) ThrowMagickException(exception,GetMagickModule(),
-          FileOpenError,"UnableToOpenFile","%s",path);
+      if (*path != '\0')
+        {
+          status=chdir(path);
+          if (status == -1)
+            (void) ThrowMagickException(exception,GetMagickModule(),
+              FileOpenError,"UnableToOpenFile","%s",path);
+        }
     }
   XFileBrowserWidget(display,windows,"Save",filename);
   if (*filename == '\0')