mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Each platform's implementation of askappend() is no longer required
to consult cfg.logxfovr, because it gets done once in logging.c. askappend() is now called only when a question _really_ needs to be asked of the user. Also in this checkin, cleanup_exit() in console.c no longer consults cfg.protocol to decide whether to save the random seed, because random_save_seed() can make that decision for itself and do it better. [originally from svn r2552]
This commit is contained in:
parent
eaff09160a
commit
1b5cb7adf6
@ -26,12 +26,10 @@ void cleanup_exit(int code)
|
|||||||
sk_cleanup();
|
sk_cleanup();
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
|
|
||||||
if (cfg.protocol == PROT_SSH) {
|
random_save_seed();
|
||||||
random_save_seed();
|
|
||||||
#ifdef MSCRYPTOAPI
|
#ifdef MSCRYPTOAPI
|
||||||
crypto_wrapup();
|
crypto_wrapup();
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
exit(code);
|
exit(code);
|
||||||
}
|
}
|
||||||
@ -212,9 +210,6 @@ int askappend(void *frontend, char *filename)
|
|||||||
|
|
||||||
char line[32];
|
char line[32];
|
||||||
|
|
||||||
if (cfg.logxfovr != LGXF_ASK) {
|
|
||||||
return ((cfg.logxfovr == LGXF_OVR) ? 2 : 1);
|
|
||||||
}
|
|
||||||
if (console_batch_mode) {
|
if (console_batch_mode) {
|
||||||
fprintf(stderr, msgtemplate_batch, FILENAME_MAX, filename);
|
fprintf(stderr, msgtemplate_batch, FILENAME_MAX, filename);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
@ -118,7 +118,10 @@ void logfopen(void *handle)
|
|||||||
if (ctx->lgfp) {
|
if (ctx->lgfp) {
|
||||||
int i;
|
int i;
|
||||||
fclose(ctx->lgfp);
|
fclose(ctx->lgfp);
|
||||||
i = askappend(ctx->frontend, ctx->currlogfilename);
|
if (cfg.logxfovr != LGXF_ASK) {
|
||||||
|
i = ((cfg.logxfovr == LGXF_OVR) ? 2 : 1);
|
||||||
|
} else
|
||||||
|
i = askappend(ctx->frontend, ctx->currlogfilename);
|
||||||
if (i == 1)
|
if (i == 1)
|
||||||
writemod[0] = 'a'; /* set append mode */
|
writemod[0] = 'a'; /* set append mode */
|
||||||
else if (i == 0) { /* cancelled */
|
else if (i == 0) { /* cancelled */
|
||||||
|
@ -204,9 +204,6 @@ int askappend(void *frontend, char *filename)
|
|||||||
|
|
||||||
char line[32];
|
char line[32];
|
||||||
|
|
||||||
if (cfg.logxfovr != LGXF_ASK) {
|
|
||||||
return ((cfg.logxfovr == LGXF_OVR) ? 2 : 1);
|
|
||||||
}
|
|
||||||
if (console_batch_mode) {
|
if (console_batch_mode) {
|
||||||
fprintf(stderr, msgtemplate_batch, FILENAME_MAX, filename);
|
fprintf(stderr, msgtemplate_batch, FILENAME_MAX, filename);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
4
windlg.c
4
windlg.c
@ -3951,9 +3951,7 @@ int askappend(void *frontend, char *filename)
|
|||||||
"or Cancel to disable logging.";
|
"or Cancel to disable logging.";
|
||||||
char message[sizeof(msgtemplate) + FILENAME_MAX];
|
char message[sizeof(msgtemplate) + FILENAME_MAX];
|
||||||
int mbret;
|
int mbret;
|
||||||
if (cfg.logxfovr != LGXF_ASK) {
|
|
||||||
return ((cfg.logxfovr == LGXF_OVR) ? 2 : 1);
|
|
||||||
}
|
|
||||||
sprintf(message, msgtemplate, FILENAME_MAX, filename);
|
sprintf(message, msgtemplate, FILENAME_MAX, filename);
|
||||||
|
|
||||||
mbret = MessageBox(NULL, message, mbtitle,
|
mbret = MessageBox(NULL, message, mbtitle,
|
||||||
|
Loading…
Reference in New Issue
Block a user