From d3fef4a5f0fbcc8990e7cd8c840e06f9675e20f9 Mon Sep 17 00:00:00 2001 From: jacob Date: Tue, 21 Jan 2003 19:18:06 +0000 Subject: [PATCH] Fix "-v" in the Windows console utilities (plink, pscp, psftp). I'm not convinced I've done this the right way (I've introduced a static for logctx in console.c) but it will do for now. git-svn-id: svn://svn.tartarus.org/sgt/putty@2674 cda61777-01e9-0310-a592-d414129be87e --- console.c | 9 +++++++++ plink.c | 1 + psftp.c | 1 + putty.h | 1 + scp.c | 1 + 5 files changed, 13 insertions(+) diff --git a/console.c b/console.c index c9284b19..27366dee 100644 --- a/console.c +++ b/console.c @@ -15,6 +15,8 @@ int console_batch_mode = FALSE; +static void *console_logctx = NULL; + /* * Clean up and exit. */ @@ -259,8 +261,15 @@ void old_keyfile_warning(void) fputs(message, stderr); } +void console_provide_logctx(void *logctx) +{ + console_logctx = logctx; +} + void logevent(void *frontend, char *string) { + if (console_logctx) + log_eventlog(console_logctx, string); } int console_get_line(const char *prompt, char *str, diff --git a/plink.c b/plink.c index 76a974ef..7bd1f901 100644 --- a/plink.c +++ b/plink.c @@ -548,6 +548,7 @@ int main(int argc, char **argv) } logctx = log_init(NULL, &cfg); back->provide_logctx(backhandle, logctx); + console_provide_logctx(logctx); sfree(realhost); } connopen = 1; diff --git a/psftp.c b/psftp.c index 2dc6e4c4..2c97db27 100644 --- a/psftp.c +++ b/psftp.c @@ -1836,6 +1836,7 @@ static int psftp_connect(char *userhost, char *user, int portnumber) } logctx = log_init(NULL, &cfg); back->provide_logctx(backhandle, logctx); + console_provide_logctx(logctx); ssh_sftp_init(); if (verbose && realhost != NULL) printf("Connected to %s\n", realhost); diff --git a/putty.h b/putty.h index da1fb870..52157e25 100644 --- a/putty.h +++ b/putty.h @@ -670,6 +670,7 @@ int askappend(void *frontend, char *filename); */ extern int console_batch_mode; int console_get_line(const char *prompt, char *str, int maxlen, int is_pw); +void console_provide_logctx(void *logctx); /* * Exports from printing.c. diff --git a/scp.c b/scp.c index c547667c..cc09a46b 100644 --- a/scp.c +++ b/scp.c @@ -580,6 +580,7 @@ static void do_cmd(char *host, char *user, char *cmd) bump("ssh_init: %s", err); logctx = log_init(NULL, &cfg); back->provide_logctx(backhandle, logctx); + console_provide_logctx(logctx); ssh_scp_init(); if (verbose && realhost != NULL) tell_user(stderr, "Connected to %s\n", realhost); -- 2.11.0