diff --git a/io.c b/io.c index c595c009..c5213f44 100644 --- a/io.c +++ b/io.c @@ -3035,21 +3035,14 @@ do_find_source(const char *src, struct stat *stb, int *errcode, path_info *pi) assert(errcode != NULL); - /* some kind of path name, no search */ - if (ispath(src)) { - emalloc(path, char *, strlen(src) + 1, "do_find_source"); - strcpy(path, src); - if (stat(path, stb) == 0) - return path; - *errcode = errno; - efree(path); - return NULL; - } - if (pi->awkpath == NULL) init_awkpath(pi); emalloc(path, char *, pi->max_pathlen + strlen(src) + 1, "do_find_source"); + strcpy(path, src); + if (stat(path, stb) == 0) + return path; + for (i = 0; pi->awkpath[i] != NULL; i++) { if (strcmp(pi->awkpath[i], "./") == 0 || strcmp(pi->awkpath[i], ".") == 0) *path = '\0';