Merge pull request #2925 from HaCk3Dq/devel

Fixed #1985
This commit is contained in:
Dominik Picheta 2015-06-14 20:25:17 +01:00
commit 9ed4efc1f8

View file

@ -1304,7 +1304,9 @@ iterator walkDir*(dir: string): tuple[kind: PathComponent, path: string] {.
when defined(linux) or defined(macosx) or defined(bsd): when defined(linux) or defined(macosx) or defined(bsd):
if x.d_type != DT_UNKNOWN: if x.d_type != DT_UNKNOWN:
if x.d_type == DT_DIR: k = pcDir if x.d_type == DT_DIR: k = pcDir
if x.d_type == DT_LNK: k = succ(k) if x.d_type == DT_LNK:
if dirExists(y): k = pcLinkToDir
else: k = succ(k)
yield (k, y) yield (k, y)
continue continue