diff options
| author | Warner Losh <imp@FreeBSD.org> | 1999-04-25 21:13:34 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 1999-04-25 21:13:34 +0000 |
| commit | 426e9c1dcc6b3d9d4a5ad436aecaa1c2f9d29e17 (patch) | |
| tree | c77cfa8ea1a0c7d542f16074d77f4bf229b98639 /bin/cp | |
| parent | 51bb7ba6641b0601252c2c5a21eb47728a1c9566 (diff) | |
Notes
Diffstat (limited to 'bin/cp')
| -rw-r--r-- | bin/cp/cp.c | 5 | ||||
| -rw-r--r-- | bin/cp/utils.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/bin/cp/cp.c b/bin/cp/cp.c index bf8901112296..e3ddbfa80bc4 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -45,7 +45,7 @@ static char const copyright[] = static char sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94"; #endif static const char rcsid[] = - "$Id: cp.c,v 1.16 1998/05/13 07:25:14 charnier Exp $"; + "$Id: cp.c,v 1.17 1998/06/09 13:42:51 dt Exp $"; #endif /* not lint */ /* @@ -295,7 +295,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 = strrchr(curr->fts_path, '/'); base = (p == NULL) ? 0 : @@ -306,6 +306,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 f6c0f0d21d55..9118efcc32f0 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94"; #endif static const char rcsid[] = - "$Id: utils.c,v 1.20 1998/06/10 06:29:23 peter Exp $"; + "$Id: utils.c,v 1.21 1998/11/18 11:47:45 bde Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -183,7 +183,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; @@ -192,6 +192,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); |
