diff --git a/applets/.qalc-safe-1 b/applets/.qalc-safe-1 new file mode 100644 index 00000000..ba25c22a --- /dev/null +++ b/applets/.qalc-safe-1 @@ -0,0 +1,6 @@ +set save definitions 1 +function export 0 +function load 0 +function command 0 +function save 0 +exit diff --git a/applets/.qalc-safe-2 b/applets/.qalc-safe-2 new file mode 100644 index 00000000..55fbffe3 --- /dev/null +++ b/applets/.qalc-safe-2 @@ -0,0 +1,2 @@ +set save definitions 0 +exit diff --git a/applets/qalc-safe b/applets/qalc-safe new file mode 100755 index 00000000..d49f4029 --- /dev/null +++ b/applets/qalc-safe @@ -0,0 +1,3 @@ +#/usr/bin/sh +yes | qalc -f .qalc-safe-1 +qalc -f .qalc-safe-2 diff --git a/applets/qalc.pl b/applets/qalc.pl index 6d078df7..6ee7c487 100755 --- a/applets/qalc.pl +++ b/applets/qalc.pl @@ -11,6 +11,18 @@ if (not @ARGV) { exit; } +my $is_safe = `qalc export`; + +if ($is_safe ne "export() = 0\n") { + system("./qalc-safe > /dev/null"); + + $is_safe = `qalc export`; + if ($is_safe ne "export() = 0\n") { + print "Fatal: Unable to make qalc safe. Execute `qalc-safe` and check for errors.\n"; + exit; + } +} + my $result = `ulimit -t 2; qalc \Q@ARGV\E`; $result =~ s/^.*approx.\s+//; diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 619f5179..9ba482de 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,8 +25,8 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4875, - BUILD_DATE => "2025-07-19", + BUILD_REVISION => 4876, + BUILD_DATE => "2025-07-20", }; sub initialize {}