misc/getfiles: fix infinite recursion loop when given a symlink

This fixes an infinite recursion loop in getFile caused by:

  1. os.Stat(file) resolves a symlink so that fileInfo.isDir() returns True
  2. filepath.Walk() starts iterating on the root directory (in this case the symlink)
  3. filepath.Walk() uses os.Lstat internally, which does NOT dereference the symlink
  4. in the walk func, f.isDir() returns False, and the walk func calls getFile() on it
  5. goto 1

fixes #47 (closed)

Merge request reports

Loading