]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
mv: fix issues with previous prompt adjustments
authorPádraig Brady <P@draigBrady.com>
Wed, 26 Mar 2014 13:36:16 +0000 (13:36 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 26 Mar 2014 15:23:23 +0000 (08:23 -0700)
* src/copy.c (overwrite_ok): Fix the gettext calls so
that the second string is tagged for translation.
Display the correct "replace ..." prompt when in move_mode.
* tests/mv/i-3.sh: Display the output on failure to ease debugging.

src/copy.c
tests/mv/i-3.sh

index 71813dc40700f713049d12a03b03ea8434fdcdf6..781cc1e153a7fa4d75e0f2805d61826ff352ba24 100644 (file)
@@ -1575,10 +1575,10 @@ overwrite_ok (struct cp_options const *x, char const *dst_name,
       strmode (dst_sb->st_mode, perms);
       perms[10] = '\0';
       fprintf (stderr,
-               _((x->unlink_dest_before_opening
-                  || x->unlink_dest_after_failed_open)
-                 ? "%s: replace %s, overriding mode %04lo (%s)? "
-                 : "%s: unwritable %s (mode %04lo, %s); try anyway? "),
+               (x->move_mode || x->unlink_dest_before_opening
+                || x->unlink_dest_after_failed_open)
+               ? _("%s: replace %s, overriding mode %04lo (%s)? ")
+               : _("%s: unwritable %s (mode %04lo, %s); try anyway? "),
                program_name, quote (dst_name),
                (unsigned long int) (dst_sb->st_mode & CHMOD_MODE_BITS),
                &perms[1]);
index 690af7385b87ce631c4d0781a32a329f9cb325c7..8c58d5d340eba797885d549b1a4423f4a1310e1d 100755 (executable)
@@ -52,7 +52,7 @@ check_overwrite_prompt()
 }
 
 # Wait for up to 12.7 seconds for the expected prompt.
-retry_delay_ check_overwrite_prompt .1 7 || fail=1
+retry_delay_ check_overwrite_prompt .1 7 || { fail=1; cat out; }
 
 kill $pid