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

oldstable
Alexandre Julliard 2010-03-16 13:14:21 +01:00
parent 1e754f5e2e
commit 5eb4b094a3
1 changed files with 4 additions and 2 deletions

View File

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