diff options
author | Till Kamppeter <tkamppeter@mandriva.com> | 2005-03-29 22:41:22 +0000 |
---|---|---|
committer | Till Kamppeter <tkamppeter@mandriva.com> | 2005-03-29 22:41:22 +0000 |
commit | 8e98926b7606d777e421b54792466c8ffbf7ba8d (patch) | |
tree | b2cf5ba21a5c8dacbaaceccf1a3c1fdb26fe6f8d /perl-install/printer/detect.pm | |
parent | c6ce49ae969ec550989a5c979d1f54bfa7858db9 (diff) | |
download | drakx-backup-do-not-use-8e98926b7606d777e421b54792466c8ffbf7ba8d.tar drakx-backup-do-not-use-8e98926b7606d777e421b54792466c8ffbf7ba8d.tar.gz drakx-backup-do-not-use-8e98926b7606d777e421b54792466c8ffbf7ba8d.tar.bz2 drakx-backup-do-not-use-8e98926b7606d777e421b54792466c8ffbf7ba8d.tar.xz drakx-backup-do-not-use-8e98926b7606d777e421b54792466c8ffbf7ba8d.zip |
- Let IOCTL detection of an USB printer not get accepted if there is no
relevant item at all in the ID string, to avoid mis-detection of some USB
keyboards as printers.
Diffstat (limited to 'perl-install/printer/detect.pm')
-rw-r--r-- | perl-install/printer/detect.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/perl-install/printer/detect.pm b/perl-install/printer/detect.pm index 606021eda..065ac23e1 100644 --- a/perl-install/printer/detect.pm +++ b/perl-install/printer/detect.pm @@ -112,6 +112,9 @@ sub whatUsbport() { my ($manufacturer, $model, $serialnumber, $description, $commandset) = ("", "", "", "", ""); my ($sku); + if ($idstr =~ /CLS:([^;]+);/ || $idstr =~ /CLASS:([^;]+);/) { + $itemfound = 1; + } if ($idstr =~ /MFG:([^;]+);/ || $idstr =~ /MANUFACTURER:([^;]+);/) { $manufacturer = $1; $manufacturer =~ s/Hewlett[-\s_]Packard/HP/; @@ -145,8 +148,8 @@ sub whatUsbport() { $itemfound = 1; } # Nothing found? Try again if not in the third attempt, - # in the third attempt always accept. - next if !$itemfound && $j < 3; + # after the third attempt give up + next if !$itemfound; # Was there a manufacturer and a model in the string? if ($manufacturer eq "" || $model eq "") { $manufacturer = ""; |