only ignore interrupt signal after input
[barcat.git] / barcat
diff --git a/barcat b/barcat
index 1b780e618d23620456c984ad6e61b36bd2438c78..2f73fa5ab2c59e3e8be6ce6b0b57fd235641587a 100755 (executable)
--- a/barcat
+++ b/barcat
@@ -100,6 +100,7 @@ if (defined $opt{interval}) {
 
 $SIG{INT} = sub {
        $SIG{INT} = 'DEFAULT';  # reset for subsequent attempts
+       exit if !$.;
        'IGNORE' # continue after assumed eof
 };