225 |
# $FILENAME |
# $FILENAME |
226 |
# find_file ($FILENAME, @INCLUDE) |
# find_file ($FILENAME, @INCLUDE) |
227 |
# ------------------------------- |
# ------------------------------- |
228 |
# We match exactly the behavior of GNU m4: first look in the current |
# We match exactly the behavior of GNU M4: first look in the current |
229 |
# directory (which includes the case of absolute file names), and, if |
# directory (which includes the case of absolute file names), and, if |
230 |
# the file is not absolute, just fail. Otherwise, look in the path. |
# the file is not absolute, just fail. Otherwise, look in @INCLUDE. |
231 |
# |
# |
232 |
# If the file is flagged as optional (ends with `?'), then return undef |
# If the file is flagged as optional (ends with `?'), then return undef |
233 |
# if absent. |
# if absent. |
249 |
return undef; |
return undef; |
250 |
} |
} |
251 |
|
|
252 |
foreach my $path (reverse @include) |
foreach my $path (@include) |
253 |
{ |
{ |
254 |
return canonpath (catfile ($path, $filename)) |
return canonpath (catfile ($path, $filename)) |
255 |
if -e catfile ($path, $filename); |
if -e catfile ($path, $filename); |