aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlx_dscv_util.erl
diff options
context:
space:
mode:
authorJordan Wilberding <[email protected]>2014-03-07 16:07:23 +0100
committerJordan Wilberding <[email protected]>2014-03-07 16:07:23 +0100
commite76af92d661dc85915abdc8486414ff5bf94d3d2 (patch)
tree3d6801666c804fd87125a1f80675e2bbcadae431 /src/rlx_dscv_util.erl
parent7b813dbc775d84a29ee08d717f084df856492251 (diff)
parent9168632da88fe32af46e1ed8dd6e6b22b4094593 (diff)
downloadrelx-e76af92d661dc85915abdc8486414ff5bf94d3d2.tar.gz
relx-e76af92d661dc85915abdc8486414ff5bf94d3d2.tar.bz2
relx-e76af92d661dc85915abdc8486414ff5bf94d3d2.zip
Merge pull request #124 from tsloughter/master
2 fixes
Diffstat (limited to 'src/rlx_dscv_util.erl')
-rw-r--r--src/rlx_dscv_util.erl29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/rlx_dscv_util.erl b/src/rlx_dscv_util.erl
index 6cfea81..a4a265c 100644
--- a/src/rlx_dscv_util.erl
+++ b/src/rlx_dscv_util.erl
@@ -115,19 +115,24 @@ discover_real_symlink_dir(ProcessDir, File) ->
ok = file:set_cwd(File),
{ok, ActualRealDir} = file:get_cwd(),
ok = file:set_cwd(CurCwd),
- lists:prefix(iolist_to_list(filename:absname(ActualRealDir)),
- iolist_to_list(filename:absname(File))),
- case ProcessDir(File, directory) of
- {ok, Result, true} ->
- [{ok, Result} | recurse(ProcessDir, File)];
- {noresult, true} ->
- recurse(ProcessDir, File);
- {ok, Result, _} ->
- [{ok, Result}];
- {noresult, _} ->
+ case lists:prefix(iolist_to_list(filename:absname(ActualRealDir)),
+ iolist_to_list(filename:absname(File))) of
+ true ->
+ %% Ignore cycles
[];
- Err = {error, _} ->
- [Err]
+ false ->
+ case ProcessDir(File, directory) of
+ {ok, Result, true} ->
+ [{ok, Result} | recurse(ProcessDir, File)];
+ {noresult, true} ->
+ recurse(ProcessDir, File);
+ {ok, Result, _} ->
+ [{ok, Result}];
+ {noresult, _} ->
+ [];
+ Err = {error, _} ->
+ [Err]
+ end
end.
recurse(ProcessDir, File) ->