1 |
/* GNU m4 -- A simple macro processor |
/* GNU m4 -- A simple macro processor |
2 |
Copyright (C) 1989, 90, 91, 92, 93, 98 Free Software Foundation, Inc. |
|
3 |
|
Copyright (C) 1989, 1990, 1991, 1992, 1993, 1998, 2004 |
4 |
|
Free Software Foundation, Inc. |
5 |
|
|
6 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
7 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
123 |
FILE *fp; |
FILE *fp; |
124 |
m4__search_path *incl; |
m4__search_path *incl; |
125 |
char *name; /* buffer for constructed name */ |
char *name; /* buffer for constructed name */ |
126 |
|
int e; |
127 |
|
|
128 |
/* Look in current working directory first. */ |
/* Look in current working directory first. */ |
129 |
fp = fopen (dir, "r"); |
fp = fopen (dir, "r"); |
137 |
/* If file not found, and filename absolute, fail. */ |
/* If file not found, and filename absolute, fail. */ |
138 |
if (*dir == '/' || m4_get_no_gnu_extensions_opt (context)) |
if (*dir == '/' || m4_get_no_gnu_extensions_opt (context)) |
139 |
return NULL; |
return NULL; |
140 |
|
e= errno; |
141 |
|
|
142 |
name = (char *) xmalloc (m4__get_search_path (context)->max_length + 1 + strlen (dir) + 1); |
name = (char *) xmalloc (m4__get_search_path (context)->max_length + 1 + strlen (dir) + 1); |
143 |
|
|
166 |
|
|
167 |
free (name); |
free (name); |
168 |
|
|
169 |
|
errno = e; |
170 |
return fp; |
return fp; |
171 |
} |
} |
172 |
|
|