diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-04-07 03:14:38 +0200 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-04-07 03:14:38 +0200 |
commit | d47cf4d53cbddda9df6863d7000542f89b07b698 (patch) | |
tree | 44a46a19fc6bed20de0c22efa7a17cf699769034 /scp.c | |
parent | - markus@cvs.openbsd.org 2001/04/05 23:39:20 (diff) | |
download | openssh-d47cf4d53cbddda9df6863d7000542f89b07b698.tar.xz openssh-d47cf4d53cbddda9df6863d7000542f89b07b698.zip |
- 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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -75,7 +75,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.64 2001/03/28 20:04:38 stevesk Exp $"); +RCSID("$OpenBSD: scp.c,v 1.65 2001/04/06 16:46:59 deraadt Exp $"); #include "xmalloc.h" #include "atomicio.h" @@ -500,10 +500,14 @@ source(argc, argv) off_t i; int amt, fd, haderr, indx, result; char *last, *name, buf[2048]; + int len; for (indx = 0; indx < argc; ++indx) { name = argv[indx]; statbytes = 0; + len = strlen(name); + while (len > 1 && name[len-1] == '/') + name[--len] = '\0'; if ((fd = open(name, O_RDONLY, 0)) < 0) goto syserr; if (fstat(fd, &stb) < 0) { |