We probably ought to make this error message smarter:
$ mkdir a
$ mv a/. b
mv: cannot move `a/.' to a subdirectory of itself, `b'
Huh? ./b is not a subdirectory of ./a. The problem is that rename(2)'s EINVAL
has two distinct reasons for occuring, either subdirectory recursion (as was
claimed in the above message), OR when either pathname matches the extended
regex /(^|\/)\.\.?\/?$/ (as was what really happened).
--
Eric Blake