correct dirname/basename for "." and "/"