File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -373,9 +373,9 @@ fn retrieve_symlink<'a>(
373373 meta : Option < std:: fs:: Metadata > ,
374374 depth : i32 ,
375375) -> Result < ( FindContext < ' a > , u64 ) > {
376- if depth >= ctx. max_depth {
377- return Ok ( ( ctx. with_path ( parent) , 0 ) ) ;
378- }
376+ // if depth >= ctx.max_depth {
377+ // return Ok((ctx.with_path(parent), 0));
378+ // }
379379 let path = ctx. path . clone ( ) ;
380380 let link_target = match std:: fs:: read_link ( path. clone ( ) ) {
381381 Ok ( v) => v,
@@ -399,6 +399,7 @@ fn retrieve_symlink<'a>(
399399 let ftype = v. file_type ( ) ;
400400 if ftype. is_symlink ( ) {
401401 ctx = ctx. with_path ( link_path. as_path ( ) ) ;
402+ // increase depth for preventing infinite loop if symlink points itself
402403 return retrieve_symlink ( ctx, parent, Some ( v) , depth + 1 ) ;
403404 }
404405 if ftype. is_file ( ) {
You can’t perform that action at this time.
0 commit comments