Fix issue 518

Don't walk the destination path when it is a subdirectory of the source.

Fixes issue 518.