diff options
author | Karl Berry <karl@freefriends.org> | 2016-02-07 00:27:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-02-07 00:27:20 +0000 |
commit | 0f5e19a268f4d86c2897f590563f21c8277c18d1 (patch) | |
tree | 7e65891f29ccde62ed60cbcc94e7fb7631429ac2 /Build/source/utils/asymptote/settings.cc | |
parent | 1b8f7f1bf982c75d77d85ac6855d48332cd41ca4 (diff) |
asy 2.36 sources
git-svn-id: svn://tug.org/texlive/trunk@39610 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/settings.cc')
-rw-r--r-- | Build/source/utils/asymptote/settings.cc | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/Build/source/utils/asymptote/settings.cc b/Build/source/utils/asymptote/settings.cc index 7b3d43529f9..67fd7a9d61b 100644 --- a/Build/source/utils/asymptote/settings.cc +++ b/Build/source/utils/asymptote/settings.cc @@ -867,7 +867,7 @@ void addOption(option *o) { void version() { - cerr << PROGRAM << " version " << VERSION << SVN_REVISION + cerr << PROGRAM << " version " << REVISION << " [(C) 2004 Andy Hammerlindl, John C. Bowman, Tom Prince]" << endl; } @@ -1331,8 +1331,15 @@ void setInteractive() (isatty(STDIN_FILENO) || getSetting<Int>("inpipe") >= 0)) interact::interactive=true; - historyname=getSetting<bool>("localhistory") ? - (string(getPath())+dirsep+"."+suffix+"_history") : (initdir+"/history"); + if(getSetting<bool>("localhistory")) + historyname=string(getPath())+dirsep+"."+suffix+"_history"; + else { + if(mkdir(initdir.c_str(),0777) != 0 && errno != EEXIST) + cerr << "failed to create directory "+initdir+"." << endl; + historyname=initdir+"/history"; + } + if(verbose > 1) + cerr << "Using history " << historyname << endl; } bool view() @@ -1401,9 +1408,10 @@ void initDir() { if(mask == 0) mask=0027; umask(mask); #endif - if(verbose > 1) - cerr << "Using configuration directory " << initdir << endl; - mkdir(initdir.c_str(),0777); + if(access(initdir.c_str(),F_OK) == 0) { + if(verbose > 1) + cerr << "Using configuration directory " << initdir << endl; + } } void setPath() { @@ -1418,7 +1426,8 @@ void setPath() { } if(i < asydir.length()) searchPath.push_back(asydir.substr(i)); } - searchPath.push_back(initdir); + if(access(initdir.c_str(),F_OK) == 0) + searchPath.push_back(initdir); string sysdir=getSetting<string>("sysdir"); if(sysdir != "") searchPath.push_back(sysdir); @@ -1571,9 +1580,8 @@ Int getScroll() if(!terminal) terminal=getenv("TERM"); if(terminal) { - int error; - error=setupterm(terminal,1,&error); #ifndef __MSDOS__ + int error=setupterm(terminal,1,&error); if(error == 0) scroll=lines > 2 ? lines-1 : 1; else #endif |