If TEMPPATH pointed to unexisted, display message and doing nothing instead abort

This commit is contained in:
Stas Degteff
2010-03-11 17:02:03 +00:00
parent 71abfaf13b
commit 0ce8534f9a
3 changed files with 19 additions and 4 deletions

View File

@@ -11,8 +11,10 @@ _____________________________________________________________________________
_____________________________________________________________________________ _____________________________________________________________________________
! <20>᫨ TEMPPATH 㪠<><EFBFBD><EBA2A0> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><E2A0AB>, Golded+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA2A0> ! <20>᫨ TEMPPATH 㪠<><EFBFBD><EBA2A0> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><E2A0AB>, Golded+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA2A0>
<><EFBFBD><E9A5AD> <20> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> UUE, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E0A5A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><EFBFBD><E9A5AD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> TEMPPATH <20> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> UUE,
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD> Golded+ <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><EFBFBD><EBA7AE> <20><><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD>, <20><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<><EFBFBD><E9A5AD> <20><>. <20><><EFBFBD><EFBFBD><EFBFBD> Golded+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><EFBFBD><E9A5AD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E0A8A9> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A0AB>.
+ <20><><EFBFBD><EFBFBD><EFBFBD> <20><>४⨢<E0A5AA><><E4A0A9> goldlang.cfg "IL_TMPINVALIDPATH" (ᮮ<><EFBFBD><E9A5AD> "Invalid + <20><><EFBFBD><EFBFBD><EFBFBD> <20><>४⨢<E0A5AA><><E4A0A9> goldlang.cfg "IL_TMPINVALIDPATH" (ᮮ<><EFBFBD><E9A5AD> "Invalid
path for temporary files (TEMPPATH) - do nothing"). path for temporary files (TEMPPATH) - do nothing").

View File

@@ -11,8 +11,10 @@ ______________________________________________________________________
______________________________________________________________________ ______________________________________________________________________
! If TEMPPATH is pointed to unexisted directory the Golded+ displays ! If TEMPPATH is pointed to unexisted directory the Golded+ displays
message and does nothing on UU-decoding, on importing result of shell message about invalid TEMPPATH and does nothing on UU-decoding, on
command and on calling extern utility. Early Golded+ are aborted. importing result of shell command, on calling extern utility and
on write message to file. Early Golded+ displayed message like
"Can't write to file /temp/D4FC54QW" or aborted.
+ New token IL_TMPINVALIDPATH for goldlang.cfg (message "Invalid path + New token IL_TMPINVALIDPATH for goldlang.cfg (message "Invalid path
for temporary files (TEMPPATH) - do nothing"). for temporary files (TEMPPATH) - do nothing").

View File

@@ -218,6 +218,17 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
} }
} }
if(strieql(tplfile, "built-in") or not fexist(tplfile) or CFG->tpl.empty()) { if(strieql(tplfile, "built-in") or not fexist(tplfile) or CFG->tpl.empty()) {
if( not ((*CFG->temppath == NUL ) or is_dir(CFG->temppath)) )
{
w_info(LNG->TMPinvalidpath);
SayBibi();
waitkeyt(10000);
w_info("");
throw_free(buf);
GFTRK(0);
return 0;
}
tmptpl = YES; // Create a temporary template tmptpl = YES; // Create a temporary template
mktemp(strcpy(tplfile, AddPath(CFG->temppath, "GDXXXXXX"))); mktemp(strcpy(tplfile, AddPath(CFG->temppath, "GDXXXXXX")));