On 08/03/2017 06:02 AM, Kamil Dudka wrote:
I suppose we could change the diagnostic to say "might destroy source"
rather than "would destroy source". That would be more accurate.
Sounds reasonable.

OK, I installed the attached.

>From 8f1b44c8901bb6183691aae093b7cc3093877260 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Thu, 3 Aug 2017 13:44:53 -0700
Subject: [PATCH] copy: more-accurate warning about destruction

* src/copy.c (copy_internal):
* tests/cp/backup-is-src.sh, tests/mv/backup-is-src.sh:
Say "might destroy", not "would destroy".
---
 src/copy.c                | 4 ++--
 tests/cp/backup-is-src.sh | 2 +-
 tests/mv/backup-is-src.sh | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/copy.c b/src/copy.c
index 9a30e16a8..c4c574050 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -2113,8 +2113,8 @@ copy_internal (char const *src_name, char const *dst_name,
                 {
                   const char *fmt;
                   fmt = (x->move_mode
-                 ? _("backing up %s would destroy source;  %s not moved")
-                 : _("backing up %s would destroy source;  %s not copied"));
+                 ? _("backing up %s might destroy source;  %s not moved")
+                 : _("backing up %s might destroy source;  %s not copied"));
                   error (0, 0, fmt,
                          quoteaf_n (0, dst_name),
                          quoteaf_n (1, src_name));
diff --git a/tests/cp/backup-is-src.sh b/tests/cp/backup-is-src.sh
index 3e4a79f39..38c310fb2 100755
--- a/tests/cp/backup-is-src.sh
+++ b/tests/cp/backup-is-src.sh
@@ -28,7 +28,7 @@ cp --b=simple a~ a > out 2>&1 && fail=1
 sed "s,cp:,XXX:," out > out2
 
 cat > exp <<\EOF
-XXX: backing up 'a' would destroy source;  'a~' not copied
+XXX: backing up 'a' might destroy source;  'a~' not copied
 EOF
 
 compare exp out2 || fail=1
diff --git a/tests/mv/backup-is-src.sh b/tests/mv/backup-is-src.sh
index 04e9f7c81..3d099cddb 100755
--- a/tests/mv/backup-is-src.sh
+++ b/tests/mv/backup-is-src.sh
@@ -38,7 +38,7 @@ sed \
   out > out2
 
 cat > exp <<\EOF
-XXX: backing up 'YYY' would destroy source;  'ZZZ' not moved
+XXX: backing up 'YYY' might destroy source;  'ZZZ' not moved
 EOF
 
 compare exp out2 || fail=1
-- 
2.13.3

Reply via email to