aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssh/sftp.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2003-04-23 16:53:02 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2003-04-23 16:53:02 +0000
commitd0c8c0bcc279fcf7568c5e97c15c115cbf83be4c (patch)
tree70033bf9d0551c1f485a8bf5c04d41148812e33a /crypto/openssh/sftp.c
parent4b17dab0ba7675679933f9f3d4aed1cd28dd0393 (diff)
downloadsrc-d0c8c0bcc279fcf7568c5e97c15c115cbf83be4c.tar.gz
src-d0c8c0bcc279fcf7568c5e97c15c115cbf83be4c.zip
Vendor import of OpenSSH-portable 3.6.1p1.
Notes
Notes: svn path=/vendor-crypto/openssh/dist/; revision=113908
Diffstat (limited to 'crypto/openssh/sftp.c')
-rw-r--r--crypto/openssh/sftp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/crypto/openssh/sftp.c b/crypto/openssh/sftp.c
index c4055b91ee47..e8adcba18f65 100644
--- a/crypto/openssh/sftp.c
+++ b/crypto/openssh/sftp.c
@@ -24,7 +24,7 @@
#include "includes.h"
-RCSID("$OpenBSD: sftp.c,v 1.31 2002/07/25 01:16:59 mouring Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.34 2003/01/10 08:19:07 fgsch Exp $");
/* XXX: short-form remote directory listings (like 'ls -C') */
@@ -49,6 +49,8 @@ FILE* infile;
size_t copy_buffer_len = 32768;
size_t num_requests = 16;
+extern int showprogress;
+
static void
connect_to_server(char *path, char **args, int *in, int *out, pid_t *sshpid)
{
@@ -108,7 +110,7 @@ usage(void)
int
main(int argc, char **argv)
{
- int in, out, ch;
+ int in, out, ch, err;
pid_t sshpid;
char *host, *userhost, *cp, *file2;
int debug_level = 0, sshver = 2;
@@ -162,6 +164,7 @@ main(int argc, char **argv)
fatal("%s (%s).", strerror(errno), optarg);
} else
fatal("Filename already specified.");
+ showprogress = 0;
break;
case 'P':
sftp_direct = optarg;
@@ -197,7 +200,7 @@ main(int argc, char **argv)
file1 = cp;
}
- if ((host = strchr(userhost, '@')) == NULL)
+ if ((host = strrchr(userhost, '@')) == NULL)
host = userhost;
else {
*host++ = '\0';
@@ -237,7 +240,7 @@ main(int argc, char **argv)
&sshpid);
}
- interactive_loop(in, out, file1, file2);
+ err = interactive_loop(in, out, file1, file2);
#if !defined(USE_PIPES)
shutdown(in, SHUT_RDWR);
@@ -254,5 +257,5 @@ main(int argc, char **argv)
fatal("Couldn't wait for ssh process: %s",
strerror(errno));
- exit(0);
+ exit(err == 0 ? 0 : 1);
}