From 27c8acdf6359eecd6d97da83e06452dc2bf82b01 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 2 Jan 2004 23:57:15 +0000 Subject: [PATCH] Delete the output file on error. Bugzilla bug #23 svn path=/trunk/yasm/; revision=1092 --- modules/preprocs/nasm/macros.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/preprocs/nasm/macros.pl b/modules/preprocs/nasm/macros.pl index bb217e15..9f0a30f0 100644 --- a/modules/preprocs/nasm/macros.pl +++ b/modules/preprocs/nasm/macros.pl @@ -22,7 +22,11 @@ print OUTPUT "/* This file auto-generated from standard.mac by macros.pl" . " - don't edit it */\n\n#include \n\nstatic const char *stdmac[] = {\n"; foreach $fname ( @ARGV ) { - open(INPUT,$fname) or die "unable to open $fname\n"; + if (not open(INPUT,$fname)) { + close(OUTPUT); + unlink("nasm-macros.c"); + die "unable to open $fname\n"; + } while () { $line++; chomp; @@ -37,6 +41,8 @@ foreach $fname ( @ARGV ) { $index++; } } else { + close(OUTPUT); + unlink("nasm-macros.c"); die "$fname:$line: error unterminated quote"; } } -- 2.40.0