Index: /lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect
===================================================================
--- /lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect	(revision 5499)
+++ /lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect	(revision 5500)
@@ -2707,9 +2707,22 @@
 sub scan_i2c_adapter
 {
-	my ($adapter_nr, $not_to_scan) = @_;
-	my ($funcs, $chip, $addr);
-
-	# As we modify it, we need a copy
-	my @not_to_scan = @$not_to_scan;
+	my ($adapter_nr) = @_;
+	my ($funcs, $chip, $addr, $input, @not_to_scan);
+
+	print "Next adapter: $i2c_adapters[$adapter_nr]->{name} (i2c-$adapter_nr)\n".
+	      "Do you want to scan it? (YES/no/selectively): ";
+
+	$input = <STDIN>;
+	return if $input =~ /^\s*n/i;
+
+	if ($input =~ /^\s*s/i) {
+		print "Please enter one or more addresses not to scan. Separate them with commas.\n",
+		      "You can specify a range by using dashes. Example: 0x58-0x5f,0x69.\n",
+		      "Addresses: ";
+		$input = <STDIN>;
+		chomp($input);
+		@not_to_scan = parse_not_to_scan(0x03, 0x77, $input);
+	}
+	print "\n";
 
 	open(local *FILE, "$dev_i2c$adapter_nr") or
@@ -4933,23 +4946,7 @@
 		print "\n";
 
-		my ($input, @not_to_scan);
 		for (my $dev_nr = 0; $dev_nr < @i2c_adapters; $dev_nr++) {
 			next unless exists $i2c_adapters[$dev_nr];
-			print "Next adapter: $i2c_adapters[$dev_nr]->{name} (i2c-$dev_nr)\n".
-			      "Do you want to scan it? (YES/no/selectively): ";
-
-			$input = <STDIN>;
-			unless ($input =~ /^\s*n/i) {
-				if ($input =~ /^\s*s/i) {
-					print "Please enter one or more addresses not to scan. Separate them with commas.\n",
-					      "You can specify a range by using dashes. Example: 0x58-0x5f,0x69.\n",
-					      "Addresses: ";
-					$input = <STDIN>;
-					chomp($input);
-					@not_to_scan = parse_not_to_scan(0x03, 0x77, $input);
-				}
-				scan_i2c_adapter($dev_nr, \@not_to_scan)
-			}
-			print "\n";
+			scan_i2c_adapter($dev_nr);
 		}
 	}
