From ee37c9202bb80ea4ee50bf463df1495eaf0d3a7c Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 25 Nov 2013 21:18:28 +0100 Subject: perl: Try to avoid boolean operators after predicates on error checks Using boolean operators after predicates for error checking makes the code flow slightly confusing, do that only after actions, to check if they succeeded and error out otherwise. --- scripts/Dpkg/Control/HashCore.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/Dpkg/Control') diff --git a/scripts/Dpkg/Control/HashCore.pm b/scripts/Dpkg/Control/HashCore.pm index 009eb1012..2cb47d8e1 100644 --- a/scripts/Dpkg/Control/HashCore.pm +++ b/scripts/Dpkg/Control/HashCore.pm @@ -224,9 +224,10 @@ sub parse { if ($expect_pgp_sig) { # Skip empty lines $_ = <$fh> while defined($_) && $_ =~ /^\s*$/; - length($_) || + unless (length $_) { $self->parse_error($desc, _g('expected PGP signature, ' . 'found EOF after blank line')); + } s/\s*\n$//; unless (m/^-----BEGIN PGP SIGNATURE-----$/) { $self->parse_error($desc, _g('expected PGP signature, ' . -- cgit v1.2.3