inpcom.c, simplify using is_plain_filename(), fix incorrect comments

This commit is contained in:
rlar 2013-12-08 15:50:47 +01:00
parent e0c398024f
commit 7524882f67
1 changed files with 6 additions and 14 deletions

View File

@ -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) {