diff options
author | Guillem Jover <guillem@debian.org> | 2014-09-12 06:08:37 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-10-06 00:48:13 +0200 |
commit | 24df99399ba5b63dc354ff49ea8622a8ca1cd17d (patch) | |
tree | d13eda06e0a54575a15d9ab70829004d757c959b /scripts/Dpkg/Control/HashCore.pm | |
parent | e7ec307653c124fa6c2a68385beddbd2f3a4f091 (diff) | |
download | dpkg-24df99399ba5b63dc354ff49ea8622a8ca1cd17d.tar.gz |
perl: Use length instead of /^$/ to test for an empty string
Addresses RegularExpressions::ProhibitFixedStringMatches.
Warned-by: perlcritic
Diffstat (limited to 'scripts/Dpkg/Control/HashCore.pm')
-rw-r--r-- | scripts/Dpkg/Control/HashCore.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/Dpkg/Control/HashCore.pm b/scripts/Dpkg/Control/HashCore.pm index 74732724b..67b264a48 100644 --- a/scripts/Dpkg/Control/HashCore.pm +++ b/scripts/Dpkg/Control/HashCore.pm @@ -197,7 +197,7 @@ sub parse { while (<$fh>) { s/\s*\n$//; - next if (m/^$/ and $paraborder); + next if length == 0 and $paraborder; next if (m/^#/); $paraborder = 0; if (m/^(\S+?)\s*:\s*(.*)$/) { @@ -232,7 +232,7 @@ sub parse { } else { $self->parse_error($desc, _g('OpenPGP signature not allowed here')); } - } elsif (m/^$/ || ($expect_pgp_sig && m/^-----BEGIN PGP SIGNATURE-----$/)) { + } elsif (length == 0 || ($expect_pgp_sig && m/^-----BEGIN PGP SIGNATURE-----$/)) { if ($expect_pgp_sig) { # Skip empty lines $_ = <$fh> while defined && m/^\s*$/; @@ -356,7 +356,7 @@ sub output { $kv .= "\n"; foreach (@lines) { s/\s+$//; - if (/^$/ or /^\.+$/) { + if (length == 0 or /^\.+$/) { $kv .= " .$_\n"; } else { $kv .= " $_\n"; |