diff options
Diffstat (limited to 'src/LYShowInfo.c')
-rw-r--r-- | src/LYShowInfo.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/LYShowInfo.c b/src/LYShowInfo.c index 56340c16..d7389761 100644 --- a/src/LYShowInfo.c +++ b/src/LYShowInfo.c @@ -33,7 +33,7 @@ PUBLIC int showinfo ARGS4( document *, newdoc, char *, owner_address) { - static char tempfile[LY_MAXPATH]; + static char tempfile[LY_MAXPATH] = "\0"; int url_type; FILE *fp0; char *Address = NULL, *Title = NULL; @@ -48,8 +48,13 @@ PUBLIC int showinfo ARGS4( struct stat dir_info; #endif /* DIRED_SUPPORT */ - LYRemoveTemp(tempfile); - if ((fp0 = LYOpenTemp (tempfile, HTML_SUFFIX, "w")) == 0) { + if (LYReuseTempfiles) { + fp0 = LYOpenTempRewrite(tempfile, HTML_SUFFIX, "w"); + } else { + LYRemoveTemp(tempfile); + fp0 = LYOpenTemp(tempfile, HTML_SUFFIX, "w"); + } + if (fp0 == NULL) { HTAlert(CANNOT_OPEN_TEMP); return(-1); } |