From 42bea9d390894ddb4c8bc8f244b8b7d916700d44 Mon Sep 17 00:00:00 2001 From: Matthew Horsfall Date: Wed, 22 Sep 2021 15:00:28 -0400 Subject: [PATCH] DC reactor: Fix cases of '0' being treated as undef --- lib/Synergy/Reactor/DC.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Synergy/Reactor/DC.pm b/lib/Synergy/Reactor/DC.pm index dedae0bf..0576036a 100644 --- a/lib/Synergy/Reactor/DC.pm +++ b/lib/Synergy/Reactor/DC.pm @@ -41,7 +41,7 @@ sub handle_dc($self, $event) { } my ($cmd) = $event->text =~ /^dc\s+(?:-e\s+)?'?(.*?)'?\s*$/i; - unless ($cmd) { + unless (length ($cmd // '')) { return $event->reply("Sory, I didn't understand that. Try: dc -e '1 2 +p', for example"); } @@ -86,7 +86,7 @@ sub handle_dc($self, $event) { $event->reply("Sorry, dc terminated on signal $exitcode"); return; - } elsif (! $resp) { + } elsif (! length($resp // '' )) { $event->reply(""); return;