diff options
-rw-r--r-- | bin/cp/cp.c | 7 | ||||
-rw-r--r-- | bin/cp/utils.c | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/bin/cp/cp.c b/bin/cp/cp.c index 179d31d284b..b0e694cc129 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cp.c,v 1.16 2001/06/22 22:51:22 millert Exp $ */ +/* $OpenBSD: cp.c,v 1.17 2001/06/25 04:35:31 art Exp $ */ /* $NetBSD: cp.c,v 1.14 1995/09/07 06:14:51 jtc Exp $ */ /* @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)cp.c 8.5 (Berkeley) 4/29/95"; #else -static char rcsid[] = "$OpenBSD: cp.c,v 1.16 2001/06/22 22:51:22 millert Exp $"; +static char rcsid[] = "$OpenBSD: cp.c,v 1.17 2001/06/25 04:35:31 art Exp $"; #endif #endif /* not lint */ @@ -331,7 +331,7 @@ copy(argv, type, fts_options) * Since the first level MUST be FTS_ROOTLEVEL, base * is always initialized. */ - if (curr->fts_level == FTS_ROOTLEVEL) + if (curr->fts_level == FTS_ROOTLEVEL) { if (type != DIR_TO_DNE) { p = find_last_component(curr->fts_path); base = p - curr->fts_path; @@ -341,6 +341,7 @@ copy(argv, type, fts_options) base += 1; } else base = curr->fts_pathlen; + } p = &curr->fts_path[base]; nlen = curr->fts_pathlen - base; diff --git a/bin/cp/utils.c b/bin/cp/utils.c index 946430c4ce5..32ee5d4cbac 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utils.c,v 1.15 2001/05/11 14:01:50 art Exp $ */ +/* $OpenBSD: utils.c,v 1.16 2001/06/25 04:35:31 art Exp $ */ /* $NetBSD: utils.c,v 1.6 1997/02/26 14:40:51 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94"; #else -static char rcsid[] = "$OpenBSD: utils.c,v 1.15 2001/05/11 14:01:50 art Exp $"; +static char rcsid[] = "$OpenBSD: utils.c,v 1.16 2001/06/25 04:35:31 art Exp $"; #endif #endif /* not lint */ @@ -169,7 +169,7 @@ copy_file(entp, dne) */ #define RETAINBITS \ (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) - else if (fs->st_mode & (S_ISUID | S_ISGID) && fs->st_uid == myuid) + else if (fs->st_mode & (S_ISUID | S_ISGID) && fs->st_uid == myuid) { if (fstat(to_fd, &to_stat)) { warn("%s", to.p_path); rval = 1; @@ -178,6 +178,7 @@ copy_file(entp, dne) warn("%s", to.p_path); rval = 1; } + } (void)close(from_fd); if (close(to_fd)) { warn("%s", to.p_path); |