From cfc8ec9f06275b8f8d146e9f6b8ba1a57be84bc0 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 5 Oct 2017 19:37:05 -0700 Subject: [PATCH] Limit qalc cpu time --- modules/qalc.pl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/qalc.pl b/modules/qalc.pl index c772a1ef..88cee4f3 100755 --- a/modules/qalc.pl +++ b/modules/qalc.pl @@ -9,14 +9,12 @@ use strict; my $args = join ' ', @ARGV; -my $qargs = quotemeta $args; - -if (not length $qargs) { +if (not length $args) { print "Usage: qalc \n"; exit; } -my $result = `qalc $qargs`; +my $result = `ulimit -t 2; qalc '$args'`; $result =~ s/^.*approx.\s+//; $result =~ s/^.*=\s+//;