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 @@ _____________________________________________________________________________
_____________________________________________________________________________
! …᫨ TEMPPATH 㪠§ë¢ ¥â ­  ­¥áãé¥áâ¢ãî騩 ª â «®£, Golded+ ¯®ª §ë¢ ¥â
á®®¡é¥­¨¥ ¨ ­¨ç¥£® ­¥ ¤¥« ¥â: ¯à¨ ¤¥ª®¤¨à®¢ ­¨¨ UUE, ¯à¨ ¨¬¯®à⥠१ã«ìâ â 
ª®¬ ­¤ë, ¯à¨ ¢ë§®¢¥ ¢­¥è­¥© ã⨫¨âë. <20> ­¥¥ Golded+  ¢ à¨©­® § ¢¥àè «áï.
á®®¡é¥­¨¥ ® ­¥¢¥à­®¬ TEMPPATH ¨ ­¨ç¥£® ­¥ ¤¥« ¥â: ¯à¨ ¤¥ª®¤¨à®¢ ­¨¨ UUE,
¯à¨ ¨¬¯®à⥠१ã«ìâ â  ª®¬ ­¤ë, ¯à¨ ¢ë§®¢¥ ¢­¥è­¥© ã⨫¨âë, ¯à¨ á®åà ­¥­¨¨
á®®¡é¥­¨ï ¢ ä ©«. <20> ­¥¥ Golded+ ¯®ª §ë¢ « á®®¡é¥­¨¥ ® ­¥¢®§¬®¦­®áâ¨
§ ¯¨á âì ä ©« «¨¡®  ¢ à¨©­® § ¢¥àè «áï.
+ <20>®¢ ï ¤¨à¥ªâ¨¢  ä ©«  goldlang.cfg "IL_TMPINVALIDPATH" (á®®¡é¥­¨¥ "Invalid
path for temporary files (TEMPPATH) - do nothing").

View File

@ -11,8 +11,10 @@ ______________________________________________________________________
______________________________________________________________________
! If TEMPPATH is pointed to unexisted directory the Golded+ displays
message and does nothing on UU-decoding, on importing result of shell
command and on calling extern utility. Early Golded+ are aborted.
message about invalid TEMPPATH and does nothing on UU-decoding, on
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
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( 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
mktemp(strcpy(tplfile, AddPath(CFG->temppath, "GDXXXXXX")));