From: cristy Date: Mon, 29 Aug 2011 16:53:16 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~7123 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0da1d6460f288f5ee5f27c7f69d6eeb8fb7902bd;p=imagemagick --- diff --git a/MagickCore/display.c b/MagickCore/display.c index f1d9f0e38..1c93b078d 100644 --- a/MagickCore/display.c +++ b/MagickCore/display.c @@ -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')