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

@@ -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")));