1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00

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.

[originally from svn r2674]
This commit is contained in:
Jacob Nevins 2003-01-21 19:18:06 +00:00
parent 30347e5313
commit 36f133b374
5 changed files with 13 additions and 0 deletions

View File

@ -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,

View File

@ -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;

View File

@ -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);

View File

@ -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.

1
scp.c
View File

@ -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);