X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/86256dc6603a868a4aca9ea47a9d23de5c25e893..47489d8daef971352cfb1ec30c998ed7b048c97c:/psftp.c diff --git a/psftp.c b/psftp.c index 47f8b634..2c97db27 100644 --- a/psftp.c +++ b/psftp.c @@ -34,6 +34,7 @@ static int do_sftp_init(void); char *pwd, *homedir; static Backend *back; static void *backhandle; +static Config cfg; /* ---------------------------------------------------------------------- * Higher-level helper functions used in commands. @@ -832,7 +833,7 @@ int sftp_cmd_chmod(struct sftp_command *cmd) if (!(subset & 06777) && (perms &~ subset)) { printf("chmod: file mode '%.*s' contains no user/group/other" " specifier and permissions other than 't' \n", - strcspn(modebegin, ","), modebegin, *mode); + strcspn(modebegin, ","), modebegin); return 0; } perms &= subset; @@ -1722,7 +1723,7 @@ static int psftp_connect(char *userhost, char *user, int portnumber) /* * Enact command-line overrides. */ - cmdline_run_saved(); + cmdline_run_saved(&cfg); /* * Trim leading whitespace off the hostname if it's there. @@ -1828,13 +1829,14 @@ static int psftp_connect(char *userhost, char *user, int portnumber) back = &ssh_backend; - err = back->init(NULL, &backhandle, cfg.host, cfg.port, &realhost, 0); + err = back->init(NULL, &backhandle, &cfg, cfg.host, cfg.port, &realhost,0); if (err != NULL) { fprintf(stderr, "ssh_init: %s\n", err); return 1; } - logctx = log_init(NULL); + 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); @@ -1883,7 +1885,7 @@ int main(int argc, char *argv[]) userhost = dupstr(argv[i]); continue; } - ret = cmdline_process_param(argv[i], i+1