inpcom.c, fix inp_pathopen(), relative path shall be expanded regarding "sourcepath"
This commit is contained in:
parent
7524882f67
commit
0ce23e6f10
|
|
@ -952,6 +952,8 @@ is_absolute_pathname(const char *p)
|
|||
}
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
static bool
|
||||
is_plain_filename(const char *p)
|
||||
{
|
||||
|
|
@ -965,6 +967,8 @@ is_plain_filename(const char *p)
|
|||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*
|
||||
Look up the variable sourcepath and try everything in the list in order
|
||||
|
|
@ -1006,10 +1010,10 @@ inp_pathopen(char *name, char *mode)
|
|||
|
||||
#endif
|
||||
|
||||
/* If this is not a plain basename, or there is no sourcepath var, just
|
||||
/* If this is an absolute filename, or there is no sourcepath var, just
|
||||
* do an fopen.
|
||||
*/
|
||||
if (!is_plain_filename(name) || !cp_getvar("sourcepath", CP_LIST, &v))
|
||||
if (is_absolute_pathname(name) || !cp_getvar("sourcepath", CP_LIST, &v))
|
||||
return (fopen(name, mode));
|
||||
|
||||
for (; v; v = v->va_next) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue