- /* File doesn't contain slashes */
- p = path_list;
- for (i = 0; i < count; i++) {
- /* Empty component in PATH is treated as . */
- buf = concat_path_file(p[0] ? p : ".", argv[0]);
- if (is_executable_file(buf, &stat_b)) {
- puts(buf);
- free(buf);
- goto next;
- }
- free(buf);
- p += strlen(p) + 1;