avoid 'recursive_find' over directory symlink

this could cause an endless recursion if a symlink pointed
upwards in the file tree
This commit is contained in:
Johan Holmberg 2016-11-09 16:42:55 +01:00
parent 4bfa4a625d
commit cfc08acd15

@ -41,7 +41,7 @@ module Cmdtest
next if entry == ".."
path = File.join(dir, entry)
relpath = prefix + entry
if File.directory?(path)
if ! File.symlink?(path) && File.directory?(path)
ignore2 = yield ignore, relpath
recursive_find(ignore2, relpath + "/", path, &block)
else