simplify substitute_path_rule_matches using filename_ncmp