diff options
Diffstat (limited to 'scripts/Dpkg/Package.pm')
-rw-r--r-- | scripts/Dpkg/Package.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/Dpkg/Package.pm b/scripts/Dpkg/Package.pm index 2a4b439b6..674a7e94f 100644 --- a/scripts/Dpkg/Package.pm +++ b/scripts/Dpkg/Package.pm @@ -29,12 +29,15 @@ our @EXPORT = qw(pkg_name_is_illegal); sub pkg_name_is_illegal($) { my $name = shift || ''; - $name eq '' && + if ($name eq '') { return _g('may not be empty string'); - $name =~ m/[^-+.0-9a-z]/o && + } + if ($name =~ m/[^-+.0-9a-z]/o) { return sprintf(_g("character '%s' not allowed"), $&); - $name =~ m/^[0-9a-z]/o || + } + if ($name !~ m/^[0-9a-z]/o) { return _g('must start with an alphanumeric character'); + } return; } |