diff options
Diffstat (limited to 'Build/source/utils/asymptote/runlabel.in')
-rw-r--r-- | Build/source/utils/asymptote/runlabel.in | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Build/source/utils/asymptote/runlabel.in b/Build/source/utils/asymptote/runlabel.in index 0fa707bfdaa..20fdf38a3a7 100644 --- a/Build/source/utils/asymptote/runlabel.in +++ b/Build/source/utils/asymptote/runlabel.in @@ -92,10 +92,19 @@ array *readpath(const string& psname, bool keep, { double vscale=vsign*hscale; array *PP=new array(0); + + char *oldPath=NULL; + string dir=stripFile(outname()); + if(!dir.empty()) { + oldPath=getPath(); + setPath(dir.c_str()); + } + mem::vector<string> cmd; cmd.push_back(getSetting<string>("gs")); cmd.push_back("-q"); cmd.push_back("-dBATCH"); + cmd.push_back("-P"); if(safe) cmd.push_back("-dSAFER"); #ifdef __MSDOS__ const string null="NUL"; @@ -104,7 +113,7 @@ array *readpath(const string& psname, bool keep, #endif cmd.push_back("-sDEVICE=epswrite"); cmd.push_back("-sOutputFile="+null); - cmd.push_back(psname); + cmd.push_back(stripDir(psname)); iopipestream gs(cmd,"gs","Ghostscript"); while(true) { stringstream buf; @@ -197,6 +206,9 @@ array *readpath(const string& psname, bool keep, } } + if(oldPath != NULL) + setPath(oldPath); + if(!keep) unlink(psname.c_str()); return PP; @@ -379,6 +391,7 @@ patharray2 *textpath(stringarray *s, penarray *p) cmd2.push_back("-dNOCACHE"); cmd2.push_back("-dNOPAUSE"); cmd2.push_back("-dBATCH"); + cmd2.push_back("-P"); if(safe) cmd2.push_back("-dSAFER"); cmd2.push_back("-sDEVICE=epswrite"); cmd2.push_back("-sOutputFile=-"); |