From 013d95af11f41cbe05abdb73c997040dce4301f8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 21 Nov 2010 18:50:41 -0800 Subject: cp: give a better diagnostic for nonexistent dest/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch was written by Jim Meyering and myself. * src/copy.c (copy_reg): Turn EISDIR to ENOTDIR to improve the quality of diagnostics for commands like "cp a nosuch/". Reported by Марк Коренберг and Alan Curry in the thread starting at: http://lists.gnu.org/archive/html/bug-coreutils/2010-11/msg00178.html * THANKS: Update. * tests/mv/trailing-slash: Add a test. --- tests/mv/trailing-slash | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/mv/trailing-slash b/tests/mv/trailing-slash index b58c90822..906174afa 100755 --- a/tests/mv/trailing-slash +++ b/tests/mv/trailing-slash @@ -50,4 +50,12 @@ done #touch a a2 #mv a a2/ && fail=1 +# Test for a cp-specific diagnostic introduced after coreutils-8.7: +printf '%s\n' \ + "cp: cannot create regular file \`no-such/': Not a directory" \ +> expected-err +touch b +cp b no-such/ 2> err && fail=1 +compare err expected-err || fail=1 + Exit $fail -- cgit v1.2.3