Hello,
I encountered the bug 2146328 (https://sourceforge.net/tracker/?func=detail&aid=2146328&group_id=154048&atid=790218#) where recursive symlink cause an infinite recursion. To reproduce, you need to create a symlink that points back to its own directory (for example, symlink "a" in folder /test points to "/test/a"). This is perfectly legal and in Finder or Terminal, you can infinitely dig into the subfolders (/test/a/a/a/a/a/a/...).
I've created a quick patch that will skip over any recursive symlinks.
What if you have /test/a/b/b/b/b/b/b/b/b/b instead? This patch looks like it only handles if the link points at the root directory. It'd be better to keep a stack of inodes seen this scan and only process inodes that are not on the stack(not a parent of the subdirectory being considered).
Good catch. You can still get caught in a loop like /test/a/test/a/test/...
I'll try a better fix when I get the chance. For the time being, I'm going to ignore symlinks altogether as I don't need it for my application.
We do have code in there for working with inodes so it shouldn't be too difficult.