mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-16 21:40:46 +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 $args = join ' ', @ARGV;
|
||||||
|
|
||||||
my $qargs = quotemeta $args;
|
if (not length $args) {
|
||||||
|
|
||||||
if (not length $qargs) {
|
|
||||||
print "Usage: qalc <expression>\n";
|
print "Usage: qalc <expression>\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $result = `qalc $qargs`;
|
my $result = `ulimit -t 2; qalc '$args'`;
|
||||||
|
|
||||||
$result =~ s/^.*approx.\s+//;
|
$result =~ s/^.*approx.\s+//;
|
||||||
$result =~ s/^.*=\s+//;
|
$result =~ s/^.*=\s+//;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user