diff --git a/modules/modperl/codegen.pl b/modules/modperl/codegen.pl index 7d25beea..a28b727a 100755 --- a/modules/modperl/codegen.pl +++ b/modules/modperl/codegen.pl @@ -67,7 +67,7 @@ namespace { } } #define PSTART_IDF(Func) PSTART; XPUSHs(GetPerlObj()); PUSH_STR(#Func) -#define PCALLMOD(Error, Success) PCALL("ZNC::Core::CallModFunc"); if (SvTRUE(ERRSV)) { DEBUG("Perl hook died with: " + PString(ERRSV)); Error; } else { if (!SvIV(ST(0))) { Error; } Success; } PEND +#define PCALLMOD(Error, Success) PCALL("ZNC::Core::CallModFunc"); if (SvTRUE(ERRSV)) { DEBUG("Perl hook died with: " + PString(ERRSV)); Error; } else if (SvIV(ST(0))) { Success; } else { Error; } PEND EOF diff --git a/modules/modperl/startup.pl b/modules/modperl/startup.pl index 4e5f7efb..aff80a7b 100644 --- a/modules/modperl/startup.pl +++ b/modules/modperl/startup.pl @@ -223,7 +223,7 @@ sub CallModFunc { my $func = shift; my @arg = @_; my $res = $pmod->$func(@arg); - (defined $res, $res, @arg) + (defined $res, $res//0, @arg) } sub CallTimer {