3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-22 20:09:43 +01:00

Limit qalc cpu time

This commit is contained in:
Pragmatic Software 2017-10-05 19:37:05 -07:00
parent 0fcbaaad4b
commit cfc8ec9f06

View File

@ -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 <expression>\n";
exit;
}
my $result = `qalc $qargs`;
my $result = `ulimit -t 2; qalc '$args'`;
$result =~ s/^.*approx.\s+//;
$result =~ s/^.*=\s+//;