From 9d480d5b438dfd5b7eaf43e7c0710394b75e61fa Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 15 Jul 2021 12:50:35 +0000 Subject: [PATCH] Bug 20817: (QA follow-up) Fix _trim Content-Type: text/plain; charset=utf-8 The patch 'trim should always return a value' does not completely do the job yet. And might have unwanted effects for the '0' case. Signed-off-by: Marcel de Rooy --- acqui/neworderempty.pl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index bcb33ac1ab..ce912860fe 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -692,10 +692,8 @@ sub staged_items_field { return (\%cellrecord); } - sub _trim { - my $string = shift; - return unless $string; + my $string = shift // q{}; $string =~ s/^\s+|\s+$//g; - return $string // q{}; + return $string; } -- 2.20.1