Alexandre Julliard : makedep: Add a helper function to open a file from the include path.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Nov 11 08:36:44 CST 2015
Module: wine
Branch: master
Commit: 54c37238a1ab526680ef0d452f3bc58bfb16eec5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=54c37238a1ab526680ef0d452f3bc58bfb16eec5
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Nov 11 15:01:43 2015 +0900
makedep: Add a helper function to open a file from the include path.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
tools/makedep.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/tools/makedep.c b/tools/makedep.c
index edfb3c7..83f7ede 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -1208,13 +1208,17 @@ static struct file *load_file( const char *name )
/*******************************************************************
- * open_file
+ * open_include_path_file
+ *
+ * Open a file from a directory on the include path.
*/
-static struct file *open_file( const struct makefile *make, const char *path, char **filename )
+static struct file *open_include_path_file( const struct makefile *make, const char *dir,
+ const char *name, char **filename )
{
- struct file *ret = load_file( base_dir_path( make, path ));
+ char *src_path = base_dir_path( make, concat_paths( dir, name ));
+ struct file *ret = load_file( src_path );
- if (ret) *filename = xstrdup( path );
+ if (ret) *filename = src_dir_path( make, concat_paths( dir, name ));
return ret;
}
@@ -1411,7 +1415,7 @@ static struct file *open_include_file( const struct makefile *make, struct incl_
}
if (*dir != '/')
{
- if ((file = open_file( make, concat_paths( dir, pFile->name ), &pFile->filename )))
+ if ((file = open_include_path_file( make, dir, pFile->name, &pFile->filename )))
return file;
}
}
More information about the wine-cvs
mailing list