From 63cb7838fb3f021e74c9774b1b89f0536bf5c169 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Sat, 4 Oct 2008 19:15:57 +0000 Subject: Reset the terminal colour when ctrl-c is pressed CVS version numbers check_trans.pl: 1.80 -> 1.81 --- check_trans.pl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'check_trans.pl') diff --git a/check_trans.pl b/check_trans.pl index 57df8459cf8..3d0c99f48cd 100755 --- a/check_trans.pl +++ b/check_trans.pl @@ -138,6 +138,9 @@ sub verbose; #== "main" #== { + # install a signal handler to catch Ctrl-C + $SIG{'INT'} = \&handle_INT; + my ($language,$file_pattern,%OPT) = parse_cmdargs(); my %translators = read_translators( $language, $OPT{m} ); my %emails_to_send; @@ -387,7 +390,15 @@ sub verbose print @_, "\n"; } - +#================================================= +#== handles INT signal +#== +sub handle_INT +{ + # reset terminal color + print color('reset'); + die( "Interrupted by user" ); +} #================================================= #== send out the emails -- cgit v1.2.3