From 9c72b925b2942e1e5201f99f5c6eb5fa6329942d Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Tue, 17 Feb 2004 13:58:09 +0000 Subject: Fixed problem that not used parallel ports were detected as printers. --- perl-install/printer/detect.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/perl-install/printer/detect.pm b/perl-install/printer/detect.pm index 038fe5006..ba7e2f1ac 100644 --- a/perl-install/printer/detect.pm +++ b/perl-install/printer/detect.pm @@ -40,15 +40,18 @@ sub whatParport() { open $F, "/proc/parport/$_/autoprobe" or open $F, "/proc/sys/dev/parport/parport$_/autoprobe" or next; { local $_; + my $itemfound = 0; while (<$F>) { if (/(.*):(.*);/) { #-# $elem->{$1} = $2; $elem->{$1} =~ s/Hewlett[-\s_]Packard/HP/; $elem->{$1} =~ s/HEWLETT[-\s_]PACKARD/HP/; + $itemfound = 1; } } # Some parallel printers miss the "CLASS" field - $elem->{CLASS} = 'PRINTER' if !defined($elem->{CLASS}); + $elem->{CLASS} = 'PRINTER' + if $itemfound && !defined($elem->{CLASS}); } push @res, { port => "/dev/lp$_", val => $elem }; } -- cgit v1.2.1