From d848c251b11f52e5cfb7da37249ec036fc91254e Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Wed, 13 Dec 2000 21:27:26 +0000 Subject: [PATCH] Fixed path resolution for a/b.c source files. --- tools/makedep.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/makedep.c b/tools/makedep.c index 97d25416ef..8b2049894b 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -207,6 +207,21 @@ static FILE *open_include_file( INCL_FILE *pFile ) } free( filename ); } + /* try in src file directory */ + if (!file) + { + char *p = strrchr(pFile->included_by->name, '/'); + if (p) + { + int l = p - pFile->included_by->name + 1; + char *filename = xmalloc(l + strlen(pFile->name) + 1); + memcpy( filename, pFile->included_by->name, l ); + strcpy( filename + l, pFile->name ); + if ((file = fopen( filename, "r" ))) pFile->filename = filename; + else free( filename ); + } + } + if (!file) { if (firstPath) perror( pFile->name ); -- 2.32.0.93.g670b81a890