From bd47226987a76f6fd704d94bcc90d81b1bece205 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Thu, 29 Mar 2001 00:39:55 +0000 Subject: [PATCH] - stevesk@cvs.openbsd.org 2001/03/28 19:56:23 [scp.c] start to sync scp closer to rcp; ok markus@ --- ChangeLog | 5 ++++- scp.c | 18 +++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88c0af3ef..14d0d1301 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,9 @@ [compat.c compat.h dh.c dh.h ssh2.h sshconnect2.c sshd.c version.h] make dh group exchange more flexible, allow min and max group size, okay markus@, deraadt@ + - stevesk@cvs.openbsd.org 2001/03/28 19:56:23 + [scp.c] + start to sync scp closer to rcp; ok markus@ 20010328 - (djm) Reorder tests and library inclusion for Krb4/AFS to try to @@ -4758,4 +4761,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1031 2001/03/29 00:36:16 mouring Exp $ +$Id: ChangeLog,v 1.1032 2001/03/29 00:39:55 mouring Exp $ diff --git a/scp.c b/scp.c index a3a3d4f69..0e510480c 100644 --- a/scp.c +++ b/scp.c @@ -75,7 +75,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.62 2001/03/21 12:33:33 markus Exp $"); +RCSID("$OpenBSD: scp.c,v 1.63 2001/03/28 19:56:23 stevesk Exp $"); #include "xmalloc.h" #include "atomicio.h" @@ -202,8 +202,6 @@ typedef struct { char *buf; } BUF; -extern int iamremote; - BUF *allocbuf(BUF *, int, int); char *colon(char *); void lostconn(int); @@ -220,7 +218,6 @@ int pflag, iamremote, iamrecursive, targetshouldbedirectory; #define CMDNEEDS 64 char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */ -int main(int, char *[]); int response(void); void rsource(char *, struct stat *); void sink(int, char *[]); @@ -295,7 +292,6 @@ main(argc, argv) iamremote = 1; tflag = 1; break; - case '?': default: usage(); } @@ -640,7 +636,7 @@ rsource(name, statp) closedir(dirp); return; } - while ((dp = readdir(dirp))) { + while ((dp = readdir(dirp)) != NULL) { if (dp->d_ino == 0) continue; if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) @@ -769,7 +765,7 @@ sink(argc, argv) if (*cp++ != ' ') SCREWUP("mode not delimited"); - for (size = 0; *cp >= '0' && *cp <= '9';) + for (size = 0; isdigit(*cp);) size = size * 10 + (*cp++ - '0'); if (*cp++ != ' ') SCREWUP("size not delimited"); @@ -852,7 +848,7 @@ bad: run_err("%s: %s", np, strerror(errno)); continue; } else if (j <= 0) { run_err("%s", j ? strerror(errno) : - "dropped connection"); + "dropped connection"); exit(1); } amt -= j; @@ -893,7 +889,7 @@ bad: run_err("%s: %s", np, strerror(errno)); if (chmod(np, omode)) #endif /* HAVE_FCHMOD */ run_err("%s: set mode: %s", - np, strerror(errno)); + np, strerror(errno)); } else { if (!exists && omode != mode) #ifdef HAVE_FCHMOD @@ -902,7 +898,7 @@ bad: run_err("%s: %s", np, strerror(errno)); if (chmod(np, omode & ~mask)) #endif /* HAVE_FCHMOD */ run_err("%s: set mode: %s", - np, strerror(errno)); + np, strerror(errno)); } if (close(ofd) == -1) { wrerr = YES; @@ -913,7 +909,7 @@ bad: run_err("%s: %s", np, strerror(errno)); setimes = 0; if (utimes(np, tv) < 0) { run_err("%s: set times: %s", - np, strerror(errno)); + np, strerror(errno)); wrerr = DISPLAYED; } }