mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-16 15:53:03 +00:00
output: do not generate source files when late errors are caught
Reported by Alexandre Duret-Lutz as "second problem" in: http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00015.html * bootstrap.conf: We need the "unlink" module. * src/files.h, src/files.c (unlink_generated_sources): New. * src/output.c: Use it. * tests/output.at: Check the case of late errors.
This commit is contained in:
10
src/files.c
10
src/files.c
@@ -398,6 +398,16 @@ output_file_name_check (char **file_name, bool source)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
unlink_generated_sources (void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < generated_files_size; i++)
|
||||
if (generated_files[i].is_source)
|
||||
/* Ignore errors. The file might not even exist. */
|
||||
unlink (generated_files[i].name);
|
||||
}
|
||||
|
||||
void
|
||||
output_file_names_free (void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user