summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-04-07 01:14:38 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-04-07 01:14:38 +0000
commitd47cf4d53cbddda9df6863d7000542f89b07b698 (patch)
tree44a46a19fc6bed20de0c22efa7a17cf699769034 /scp.c
parente34ab4c04eace868c3ea95810161abf16db6231f (diff)
- deraadt@cvs.openbsd.org 2001/04/06 16:46:59
[scp.c] remove trailing / from source paths; fixes pr#1756
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/scp.c b/scp.c
index bd2c5c751..d317a71e1 100644
--- a/scp.c
+++ b/scp.c
@@ -75,7 +75,7 @@
75 */ 75 */
76 76
77#include "includes.h" 77#include "includes.h"
78RCSID("$OpenBSD: scp.c,v 1.64 2001/03/28 20:04:38 stevesk Exp $"); 78RCSID("$OpenBSD: scp.c,v 1.65 2001/04/06 16:46:59 deraadt Exp $");
79 79
80#include "xmalloc.h" 80#include "xmalloc.h"
81#include "atomicio.h" 81#include "atomicio.h"
@@ -500,10 +500,14 @@ source(argc, argv)
500 off_t i; 500 off_t i;
501 int amt, fd, haderr, indx, result; 501 int amt, fd, haderr, indx, result;
502 char *last, *name, buf[2048]; 502 char *last, *name, buf[2048];
503 int len;
503 504
504 for (indx = 0; indx < argc; ++indx) { 505 for (indx = 0; indx < argc; ++indx) {
505 name = argv[indx]; 506 name = argv[indx];
506 statbytes = 0; 507 statbytes = 0;
508 len = strlen(name);
509 while (len > 1 && name[len-1] == '/')
510 name[--len] = '\0';
507 if ((fd = open(name, O_RDONLY, 0)) < 0) 511 if ((fd = open(name, O_RDONLY, 0)) < 0)
508 goto syserr; 512 goto syserr;
509 if (fstat(fd, &stb) < 0) { 513 if (fstat(fd, &stb) < 0) {