Browse Source

inpcom.c, fix inp_pathopen(), relative path shall be expanded regarding "sourcepath"

pre-master-46
rlar 13 years ago
parent
commit
0ce23e6f10
  1. 8
      src/frontend/inpcom.c

8
src/frontend/inpcom.c

@ -952,6 +952,8 @@ is_absolute_pathname(const char *p)
} }
#if 0
static bool static bool
is_plain_filename(const char *p) is_plain_filename(const char *p)
{ {
@ -965,6 +967,8 @@ is_plain_filename(const char *p)
#endif #endif
} }
#endif
/*-------------------------------------------------------------------------* /*-------------------------------------------------------------------------*
Look up the variable sourcepath and try everything in the list in order Look up the variable sourcepath and try everything in the list in order
@ -1006,10 +1010,10 @@ inp_pathopen(char *name, char *mode)
#endif #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. * 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)); return (fopen(name, mode));
for (; v; v = v->va_next) { for (; v; v = v->va_next) {

Loading…
Cancel
Save