Commit 184c40a3 authored by Alexandre Julliard's avatar Alexandre Julliard

Try to open source file in current directory first in case it is a

generated file.
parent bc8b8a22
......@@ -189,18 +189,24 @@ static FILE *open_src_file( INCL_FILE *pFile )
{
FILE *file;
/* first try name as is */
if ((file = fopen( pFile->name, "r" )))
{
pFile->filename = xstrdup( pFile->name );
return file;
}
/* now try in source dir */
if (SrcDir)
{
pFile->filename = xmalloc( strlen(SrcDir) + strlen(pFile->name) + 2 );
strcpy( pFile->filename, SrcDir );
strcat( pFile->filename, "/" );
strcat( pFile->filename, pFile->name );
file = fopen( pFile->filename, "r" );
}
else pFile->filename = xstrdup( pFile->name );
if (!(file = fopen( pFile->filename, "r" )))
if (!file)
{
perror( pFile->filename );
perror( pFile->name );
exit(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