summaryrefslogtreecommitdiff
path: root/bin/rcp/rcp.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-04-06 16:47:00 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-04-06 16:47:00 +0000
commit6209f66f007f22b2c63cf1f11d43aab847702490 (patch)
tree87caaf40a559792c5ff172d586921c273c8efb76 /bin/rcp/rcp.c
parent4de5170396cc9f30d77a2b1216d1a35e1c90cf8e (diff)
remove trailing / from source paths; fixes pr#1756
Diffstat (limited to 'bin/rcp/rcp.c')
-rw-r--r--bin/rcp/rcp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c
index a473c0737fb..bfdb16bc29b 100644
--- a/bin/rcp/rcp.c
+++ b/bin/rcp/rcp.c
@@ -1,5 +1,5 @@
/* $NetBSD: rcp.c,v 1.9 1995/03/21 08:19:06 cgd Exp $ */
-/* $OpenBSD: rcp.c,v 1.18 1997/12/08 05:15:29 deraadt Exp $ */
+/* $OpenBSD: rcp.c,v 1.19 2001/04/06 16:46:59 deraadt Exp $ */
/*
* Copyright (c) 1983, 1990, 1992, 1993
@@ -403,9 +403,13 @@ source(argc, argv)
off_t i;
int amt, fd, haderr, indx, result;
char *last, *name, buf[BUFSIZ];
+ int len;
for (indx = 0; indx < argc; ++indx) {
name = argv[indx];
+ 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)) {