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:
parent
0fcbaaad4b
commit
cfc8ec9f06
@ -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+//;
|
||||
|
Loading…
Reference in New Issue
Block a user