add testcase for and fix problem when filename starting with the same name as the current dir not in the current dir encountered when processing dir