It is possible for readDir
to incorrectly enumerate files from a symlinked directory if called recursively when specifying an empty string for the dir parameter as outlined in this issue.
This is corrected in this PR by checking if a directory is a symlink before reading from it.