This code cannot be reached. The routine IMFS_find_match_in_dir is called only if the token type is IMFS_NAME. If ".." is present in the path, the token type returned by IMFS_get_token would be IMFS_DIR_UP. With such a setup, IMFS_find_match_in_dir cannot be called with the name as ".."