Commit 5eb4b094 authored by Alexandre Julliard's avatar Alexandre Julliard

makedep: Append the separator if not found in an existing makefile.

parent 1e754f5e
...@@ -929,15 +929,17 @@ static void output_dependencies(void) ...@@ -929,15 +929,17 @@ static void output_dependencies(void)
{ {
char buffer[1024]; char buffer[1024];
FILE *tmp_file = create_temp_file( &tmp_name ); FILE *tmp_file = create_temp_file( &tmp_name );
int found = 0;
while (fgets( buffer, sizeof(buffer), file )) while (fgets( buffer, sizeof(buffer), file ) && !found)
{ {
if (fwrite( buffer, 1, strlen(buffer), tmp_file ) != strlen(buffer)) if (fwrite( buffer, 1, strlen(buffer), tmp_file ) != strlen(buffer))
fatal_error( "error writing to %s\n", tmp_name ); fatal_error( "error writing to %s\n", tmp_name );
if (!strncmp( buffer, Separator, strlen(Separator) )) break; found = !strncmp( buffer, Separator, strlen(Separator) );
} }
fclose( file ); fclose( file );
file = tmp_file; file = tmp_file;
if (!found && list_head(&sources)) fprintf( file, "\n%s\n", Separator );
} }
else else
{ {
......
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