If it works correctly in NMDC, I did a quick code compare between ADC and NMDC method of ShareManager::Directory::search(...). The biggest difference I see is that nested directories are being compared against "cur" in NMDC but against "aStrings.include" in ADC. I think that "cur" can be modified by current directory but "aStrings" should stay unmodified through whole search process. And the nested directories could always get "cur" only.
If it works correctly in NMDC, I did a quick code compare between ADC and NMDC method of ShareManager: :Directory: :search( ...). The biggest difference I see is that nested directories are being compared against "cur" in NMDC but against "aStrings.include" in ADC. I think that "cur" can be modified by current directory but "aStrings" should stay unmodified through whole search process. And the nested directories could always get "cur" only.