From f01e7c63642a459816ff9722cbeb5247658b2bf0 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 20 Nov 2003 04:21:56 +0000 Subject: [PATCH] open_input_file(): try to open the file in the current directory before trying the source directory. --- tools/winebuild/utils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c index 440c7742981..2736ba0d6cc 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -176,18 +176,19 @@ void dump_bytes( FILE *outfile, const unsigned char *data, int len, FILE *open_input_file( const char *srcdir, const char *name ) { char *fullname; - FILE *file; + FILE *file = fopen( name, "r" ); - if (srcdir) + if (!file && srcdir) { fullname = xmalloc( strlen(srcdir) + strlen(name) + 2 ); strcpy( fullname, srcdir ); strcat( fullname, "/" ); strcat( fullname, name ); + file = fopen( fullname, "r" ); } else fullname = xstrdup( name ); - if (!(file = fopen( fullname, "r" ))) fatal_error( "Cannot open file '%s'\n", fullname ); + if (!file) fatal_error( "Cannot open file '%s'\n", fullname ); input_file_name = fullname; current_line = 1; return file;