inpcom.c, fix inp_pathopen(), always try to fopen() relative to the current working directory first

This commit is contained in:
rlar 2013-10-31 20:58:44 +01:00
parent 0ce23e6f10
commit 9b4238ed04
1 changed files with 6 additions and 4 deletions

View File

@ -1010,11 +1010,13 @@ inp_pathopen(char *name, char *mode)
#endif
/* If this is an absolute filename, or there is no sourcepath var, just
* do an fopen.
*/
/* just try it */
if ((fp = fopen(name, mode)) != NULL)
return fp;
/* fail if this was an absolute filename or if there is no sourcepath var */
if (is_absolute_pathname(name) || !cp_getvar("sourcepath", CP_LIST, &v))
return (fopen(name, mode));
return NULL;
for (; v; v = v->va_next) {