diff options
| author | Wolfram Schneider <wosch@FreeBSD.org> | 1996-02-19 00:44:19 +0000 |
|---|---|---|
| committer | Wolfram Schneider <wosch@FreeBSD.org> | 1996-02-19 00:44:19 +0000 |
| commit | d7e0e5ca0f82c11324beedc8e7d256102e2ef965 (patch) | |
| tree | 9b8f8df0eb9caf897a1cbf95bc707616786a4937 /bin/cp/utils.c | |
| parent | 8ec7a852b0cbbd7348b05373ea0fd79d3c288c08 (diff) | |
Notes
Diffstat (limited to 'bin/cp/utils.c')
| -rw-r--r-- | bin/cp/utils.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/bin/cp/utils.c b/bin/cp/utils.c index ca7017c8e451..0aa480d7b163 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -86,21 +86,12 @@ copy_file(entp, dne) checkch = ch = getchar(); while (ch != '\n' && ch != EOF) ch = getchar(); - if (checkch != 'y' && checkch != 'Y') { + if (checkch != 'y') { (void)close(from_fd); return (0); } } - - if (fflag) { - /* remove existing destination file name, - * create a new file */ - (void)unlink(to.p_path); - to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT, - fs->st_mode & ~(S_ISUID | S_ISGID)); - } else - /* overwrite existing destination file name */ - to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0); + to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0); } else to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT, fs->st_mode & ~(S_ISUID | S_ISGID)); @@ -290,7 +281,7 @@ void usage() { (void)fprintf(stderr, "%s\n%s\n", -"usage: cp [-R [-H | -L | -P] [-f | -i] [-p] src target", -" cp [-R [-H | -L | -P] [-f | -i] [-p] src1 ... srcN directory"); +"usage: cp [-R [-H | -L | -P] [-fip] src target", +" cp [-R [-H | -L | -P] [-fip] src1 ... srcN directory"); exit(1); } |
