fixes dirname/basename logic when dirname is `.`