Andreas Schwab writes: >> So, any objections to apply my patch to trunk with these changes? > > You also need to check whether the target is a subdirectory of the > source. To clarify: --8<---------------cut here---------------start------------->8--- thierry@thierry-MM061:~$ cd ~/tmp/Test/ thierry@thierry-MM061:~/tmp/Test$ ls -R .: Test1 ./Test1: Test2 ./Test1/Test2: Test3 ./Test1/Test2/Test3: thierry@thierry-MM061:~/tmp/Test$ LC_ALL=C cp -r ~/tmp/Test/ ~/tmp/Test/Test1/Test2/Test3/ cp: cannot copy a directory, `/home/thierry/tmp/Test/', into itself, `/home/thierry/tmp/Test/Test1/Test2/Test3/Test' --8<---------------cut here---------------end--------------->8--- So we need to check this. (See `file-subdir-of-p' in this patch)