diff options
author | wosch <wosch@FreeBSD.org> | 1997-10-03 18:11:14 +0000 |
---|---|---|
committer | wosch <wosch@FreeBSD.org> | 1997-10-03 18:11:14 +0000 |
commit | 78784d5f321b2d8c5196ef227410d22f4297b68f (patch) | |
tree | c27dc0b62e16ea88b7315263eccc8559e1522f12 /bin/cp/utils.c | |
parent | 2af063b33b49ca467021c43acd6ea52c0bc2023c (diff) | |
download | FreeBSD-src-78784d5f321b2d8c5196ef227410d22f4297b68f.zip FreeBSD-src-78784d5f321b2d8c5196ef227410d22f4297b68f.tar.gz |
cp(1) is too silent if used with the option -i. It should
print which input cp(1) expect (y/n) and print a warning if the
file was not overwritten.
Diffstat (limited to 'bin/cp/utils.c')
-rw-r--r-- | bin/cp/utils.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/cp/utils.c b/bin/cp/utils.c index 363a840..ecd9790 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: utils.c,v 1.13 1997/02/22 14:01:34 peter Exp $ */ #ifndef lint @@ -81,13 +81,16 @@ copy_file(entp, dne) * modified by the umask.) */ if (!dne) { +#define YESNO "(y/n [n]) " if (iflag) { - (void)fprintf(stderr, "overwrite %s? ", to.p_path); + (void)fprintf(stderr, "overwrite %s? %s", + to.p_path, YESNO); checkch = ch = getchar(); while (ch != '\n' && ch != EOF) ch = getchar(); if (checkch != 'y' && checkch != 'Y') { (void)close(from_fd); + (void)fprintf(stderr, "not overwritten\n"); return (0); } } |