diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index c1e02f6c4..ce367aac4 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1004,22 +1004,14 @@ inp_pathopen(char *name, char *mode) return (fp); } - /* If this is an abs pathname, or there is no sourcepath var, just - * do an fopen. - */ - if (strchr(name, DIR_TERM) || strchr(name, DIR_TERM_LINUX) || - !cp_getvar("sourcepath", CP_LIST, &v)) - return (fopen(name, mode)); -#else - - /* If this is an abs pathname, or there is no sourcepath var, just - * do an fopen. - */ - if (strchr(name, DIR_TERM) || !cp_getvar("sourcepath", CP_LIST, &v)) - return (fopen(name, mode)); - #endif + /* If this is not a plain basename, or there is no sourcepath var, just + * do an fopen. + */ + if (!is_plain_filename(name) || !cp_getvar("sourcepath", CP_LIST, &v)) + return (fopen(name, mode)); + for (; v; v = v->va_next) { switch (v->va_type) {