diff options
author | Guillem Jover <guillem@debian.org> | 2013-11-25 21:18:28 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2013-12-04 06:56:56 +0100 |
commit | ee37c9202bb80ea4ee50bf463df1495eaf0d3a7c (patch) | |
tree | e6fd1c2c6a0e4e13ecba2804ea909a5c8c7e2eee /scripts/Dpkg/Control | |
parent | 0f802f0071e0efd7a260f83c5efc554f0ba585d9 (diff) | |
download | dpkg-ee37c9202bb80ea4ee50bf463df1495eaf0d3a7c.tar.gz |
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.
Diffstat (limited to 'scripts/Dpkg/Control')
-rw-r--r-- | scripts/Dpkg/Control/HashCore.pm | 3 |
1 files changed, 2 insertions, 1 deletions
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, ' . |