Commit f01e7c63 authored by Alexandre Julliard's avatar Alexandre Julliard

open_input_file(): try to open the file in the current directory

before trying the source directory.
parent cd1a13b0
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment