makedep: Allow the source directory itself in include paths.
This commit is contained in:
parent
d9f9500158
commit
4674566ba4
|
@ -536,7 +536,7 @@ static FILE *open_include_file( struct incl_file *pFile )
|
||||||
{
|
{
|
||||||
FILE *file = NULL;
|
FILE *file = NULL;
|
||||||
char *filename, *p;
|
char *filename, *p;
|
||||||
unsigned int i;
|
unsigned int i, len;
|
||||||
|
|
||||||
errno = ENOENT;
|
errno = ENOENT;
|
||||||
|
|
||||||
|
@ -664,8 +664,9 @@ static FILE *open_include_file( struct incl_file *pFile )
|
||||||
{
|
{
|
||||||
/* ignore absolute paths that don't point into the source dir */
|
/* ignore absolute paths that don't point into the source dir */
|
||||||
if (!top_src_dir) continue;
|
if (!top_src_dir) continue;
|
||||||
if (strncmp( dir, top_src_dir, strlen(top_src_dir) )) continue;
|
len = strlen( top_src_dir );
|
||||||
if (dir[strlen(top_src_dir)] != '/') continue;
|
if (strncmp( dir, top_src_dir, len )) continue;
|
||||||
|
if (dir[len] && dir[len] != '/') continue;
|
||||||
}
|
}
|
||||||
filename = strmake( "%s/%s", dir, pFile->name );
|
filename = strmake( "%s/%s", dir, pFile->name );
|
||||||
if ((file = fopen( filename, "r" ))) goto found;
|
if ((file = fopen( filename, "r" ))) goto found;
|
||||||
|
|
Loading…
Reference in New Issue