- /* 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;
+ char *path;
+ char *tmp;
+ char *p;
+
+ path = tmp = xstrdup(env_path);
+ while ((p = find_executable(*argv, &tmp)) != NULL) {
+ missing = 0;
+ puts(p);
+ free(p);
+ if (!option_mask32) /* -a not set */
+ break;