summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/printerdrake.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2005-09-01 19:29:15 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2005-09-01 19:29:15 +0000
commita9725a8b9f4ce81a9409fa405d1091e75b9f2afc (patch)
tree622d8bb88b7e818484693b8402d6a4d7ecc07e4e /perl-install/printer/printerdrake.pm
parent4264ef38561bacd72025147fa775bf55bb2a67dd (diff)
downloaddrakx-a9725a8b9f4ce81a9409fa405d1091e75b9f2afc.tar
drakx-a9725a8b9f4ce81a9409fa405d1091e75b9f2afc.tar.gz
drakx-a9725a8b9f4ce81a9409fa405d1091e75b9f2afc.tar.bz2
drakx-a9725a8b9f4ce81a9409fa405d1091e75b9f2afc.tar.xz
drakx-a9725a8b9f4ce81a9409fa405d1091e75b9f2afc.zip
- Do not display or use the description field of the IEEE-1284 ID
string of a printer if it is shorter than 5 characters (Many HP printers have a 4-digit number there).
Diffstat (limited to 'perl-install/printer/printerdrake.pm')
-rw-r--r--perl-install/printer/printerdrake.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm
index 26a7ab402..46e5a2fdf 100644
--- a/perl-install/printer/printerdrake.pm
+++ b/perl-install/printer/printerdrake.pm
@@ -1452,7 +1452,8 @@ sub setup_local_autoscan {
my @str;
foreach my $p (@autodetected) {
if (($p->{val}{DESCRIPTION}) || ($p->{val}{MODEL})) {
- my $menustr = ($p->{val}{DESCRIPTION} ?
+ my $menustr = (defined($p->{val}{DESCRIPTION}) &&
+ (length($p->{val}{DESCRIPTION}) > 5) ?
$p->{val}{DESCRIPTION} :
(($p->{val}{MANUFACTURER} ?
($p->{val}{MANUFACTURER} . " ") : ()) .
@@ -2825,7 +2826,7 @@ sub setup_common {
$descr = "$descrmake|$autosku";
} elsif ($automake && $automodel) {
$descr = "$descrmake|$automodel";
- } elsif ($autodescr) {
+ } elsif ($autodescr && (length($autodescr) > 5)) {
$descr = $autodescr;
$descr =~ s/ /|/;
} elsif ($automodel) {
@@ -2930,7 +2931,7 @@ sub setup_common {
# exact match or a match to the auto-detection ID string
next if $matchlength >= 100;
# Try to match the (human-readable) make and model of the
- # Foomatic database or of thr PPD file
+ # Foomatic database or of the PPD file
my $dbmakemodel;
if ($printer->{expert}) {
$dbmakemodel = $1 if $entry =~ m/^(.*)\|[^\|]*$/;