version 1.44, 2006/01/20 23:10:19 |
version 1.45, 2007/01/18 17:49:51 |
|
|
* that directory later on. |
* that directory later on. |
*/ |
*/ |
char * |
char * |
Dir_FindFilei(const char *name, const char *ename, Lst path) |
Dir_FindFileComplexi(const char *name, const char *ename, Lst path, |
|
bool checkCurdirFirst) |
{ |
{ |
Path *p; /* current path member */ |
Path *p; /* current path member */ |
char *p1; /* pointer into p->name */ |
char *p1; /* pointer into p->name */ |
|
|
|
|
if (DEBUG(DIR)) |
if (DEBUG(DIR)) |
printf("Searching for %s...", name); |
printf("Searching for %s...", name); |
/* No matter what, we always look for the file in the current directory |
/* Unless checkCurDirFirst is false, we always look for |
* before anywhere else and we always return exactly what the caller |
* the file in the current directory before anywhere else |
* specified. */ |
* and we always return exactly what the caller specified. */ |
if ((!hasSlash || (cp - name == 2 && *name == '.')) && |
if (checkCurdirFirst && (!hasSlash || (cp - name == 2 && *name == '.')) && |
find_file_hashi(dot, cp, ename, hv) != NULL) { |
find_file_hashi(dot, cp, ename, hv) != NULL) { |
if (DEBUG(DIR)) |
if (DEBUG(DIR)) |
printf("in '.'\n"); |
printf("in '.'\n"); |