e.g. what if the basePath is "/a/b/c/"? in the current impl, the result will be /a/b/c//...