If TEMPPATH pointed to unexisted, display message and doing nothing instead abort
This commit is contained in:
parent
e734e7d80a
commit
71abfaf13b
@ -10,6 +10,10 @@ _____________________________________________________________________________
|
||||
‡ ¬¥âª¨ ¤«ï GoldED+ 1.1.5, /snapshot/
|
||||
_____________________________________________________________________________
|
||||
|
||||
! …᫨ TEMPPATH 㪠§ë¢ ¥â ¥áãé¥áâ¢ãî騩 ª â «®£, Golded+ ¯®ª §ë¢ ¥â
|
||||
á®®¡é¥¨¥ ¨ ¨ç¥£® ¥ ¤¥« ¥â: ¯à¨ ¤¥ª®¤¨à®¢ ¨¨ UUE, ¯à¨ ¨¬¯®à⥠१ã«ìâ â
|
||||
ª®¬ ¤ë, ¯à¨ ¢ë§®¢¥ ¢¥è¥© ã⨫¨âë. <20> ¥¥ Golded+ ¢ ਩® § ¢¥àè «áï.
|
||||
|
||||
+ <20>®¢ ï ¤¨à¥ªâ¨¢ ä ©« goldlang.cfg "IL_TMPINVALIDPATH" (á®®¡é¥¨¥ "Invalid
|
||||
path for temporary files (TEMPPATH) - do nothing").
|
||||
|
||||
|
@ -10,6 +10,10 @@ ______________________________________________________________________
|
||||
Notes for GoldED+ 1.1.5, /snapshot/
|
||||
______________________________________________________________________
|
||||
|
||||
! 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.
|
||||
|
||||
+ New token IL_TMPINVALIDPATH for goldlang.cfg (message "Invalid path
|
||||
for temporary files (TEMPPATH) - do nothing").
|
||||
|
||||
|
@ -946,6 +946,17 @@ void IEclass::editimport(Line* __line, char* __filename, bool imptxt) {
|
||||
if(filenamebuf.c_str()[0] == '|'){
|
||||
Path cmdline;
|
||||
|
||||
if( not ((*CFG->temppath == NUL ) or is_dir(CFG->temppath)) )
|
||||
{
|
||||
w_info(LNG->TMPinvalidpath);
|
||||
SayBibi();
|
||||
waitkeyt(10000);
|
||||
w_info("");
|
||||
AA->SetXlatimport(__oldxlatimport);
|
||||
GFTRK(0);
|
||||
return;
|
||||
}
|
||||
|
||||
isPipe = YES;
|
||||
mktemp(strxcpy(tmpfile, AddPath(CFG->temppath, "GIXXXXXX"), sizeof(Path)));
|
||||
strxmerge(cmdline, sizeof(Path), filenamebuf.c_str()+1, " > ", tmpfile, NULL);
|
||||
|
@ -538,16 +538,12 @@ void TouchNetscan(int popup)
|
||||
int ExternUtil(GMsg *msg, const ExtUtil &extutil)
|
||||
{
|
||||
Path editorfile, tmpfile, buf;
|
||||
strxcpy(editorfile, AddPath(CFG->goldpath, EDIT->File()), sizeof(Path));
|
||||
|
||||
std::string cmdline = extutil.cmdline;
|
||||
|
||||
int mode = (extutil.options & EXTUTIL_KEEPCTRL) ? MODE_SAVE : MODE_SAVENOCTRL;
|
||||
SaveLines(mode, editorfile, msg, 79);
|
||||
strcpy(buf, editorfile);
|
||||
strchg(buf, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
|
||||
strischg(cmdline, "@file", buf);
|
||||
|
||||
if(striinc("@tmpfile", cmdline.c_str()))
|
||||
{
|
||||
if( (*CFG->temppath == NUL ) or is_dir(CFG->temppath) )
|
||||
{
|
||||
mktemp(strcpy(tmpfile, AddPath(CFG->temppath, "GDXXXXXX")));
|
||||
SaveLines(mode, tmpfile, msg, 79);
|
||||
@ -555,8 +551,25 @@ int ExternUtil(GMsg *msg, const ExtUtil &extutil)
|
||||
strchg(buf, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
|
||||
strischg(cmdline, "@tmpfile", buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
w_info(LNG->TMPinvalidpath);
|
||||
SayBibi();
|
||||
waitkeyt(10000);
|
||||
w_info("");
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
else
|
||||
tmpfile[0] = NUL;
|
||||
|
||||
strxcpy(editorfile, AddPath(CFG->goldpath, EDIT->File()), sizeof(Path));
|
||||
|
||||
SaveLines(mode, editorfile, msg, 79);
|
||||
strcpy(buf, editorfile);
|
||||
strchg(buf, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
|
||||
strischg(cmdline, "@file", buf);
|
||||
|
||||
strcpy(buf, CFG->goldpath);
|
||||
strchg(buf, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
|
||||
strischg(cmdline, "@path", buf);
|
||||
@ -840,6 +853,15 @@ void UUDecode(GMsg* msg) {
|
||||
Path infile, outfile;
|
||||
bool ok = false;
|
||||
|
||||
if( not ((*CFG->temppath == NUL ) or is_dir(CFG->temppath)) )
|
||||
{
|
||||
w_info(LNG->TMPinvalidpath);
|
||||
SayBibi();
|
||||
waitkeyt(10000);
|
||||
w_info("");
|
||||
return;
|
||||
}
|
||||
|
||||
if((*CFG->uudecodepath == NUL) or is_dir(CFG->uudecodepath)) {
|
||||
|
||||
mktemp(strcpy(infile, AddPath(CFG->temppath, "GDXXXXXX")));
|
||||
|
Reference in New Issue
Block a user