summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2005-03-29 22:41:22 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2005-03-29 22:41:22 +0000
commit8e98926b7606d777e421b54792466c8ffbf7ba8d (patch)
treeb2cf5ba21a5c8dacbaaceccf1a3c1fdb26fe6f8d
parentc6ce49ae969ec550989a5c979d1f54bfa7858db9 (diff)
downloaddrakx-8e98926b7606d777e421b54792466c8ffbf7ba8d.tar
drakx-8e98926b7606d777e421b54792466c8ffbf7ba8d.tar.gz
drakx-8e98926b7606d777e421b54792466c8ffbf7ba8d.tar.bz2
drakx-8e98926b7606d777e421b54792466c8ffbf7ba8d.tar.xz
drakx-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.
-rw-r--r--perl-install/printer/detect.pm7
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 = "";