fix wrong test on path_len (leads to '/' being incorrectly detected as regular file)