1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-14 09:37:34 -05:00

Make file-existence test a per-platform function.

NFC in this commit, but this will allow me to do something more subtle
and OS-specific in each OS's implementation of it.
This commit is contained in:
Simon Tatham
2018-02-07 07:22:18 +00:00
parent 36764ffbbe
commit bbebdc8280
4 changed files with 24 additions and 4 deletions

View File

@ -164,7 +164,6 @@ void logfopen(void *handle)
{
struct LogContext *ctx = (struct LogContext *)handle;
struct tm tm;
FILE *fp;
int mode;
/* Prevent repeat calls */
@ -184,10 +183,8 @@ void logfopen(void *handle)
conf_get_str(ctx->conf, CONF_host),
conf_get_int(ctx->conf, CONF_port), &tm);
fp = f_open(ctx->currlogfilename, "r", FALSE); /* file already present? */
if (fp) {
if (open_for_write_would_lose_data(ctx->currlogfilename)) {
int logxfovr = conf_get_int(ctx->conf, CONF_logxfovr);
fclose(fp);
if (logxfovr != LGXF_ASK) {
mode = ((logxfovr == LGXF_OVR) ? 2 : 1);
} else