From 6f3e6537d28cf9c2de2c4c2427ed5a4e9c9f06d1 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 24 Apr 2012 21:17:30 +0000 Subject: fix removing several notebook pages --- perl-install/diskdrake/hd_gtk.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'perl-install/diskdrake') diff --git a/perl-install/diskdrake/hd_gtk.pm b/perl-install/diskdrake/hd_gtk.pm index 70f8a3f57..3ccc84d12 100644 --- a/perl-install/diskdrake/hd_gtk.pm +++ b/perl-install/diskdrake/hd_gtk.pm @@ -285,9 +285,15 @@ sub create_automatic_notebooks { $may_add->(raid2kind()) if @{$all_hds->{raids}}; $may_add->(loopback2kind()) if @{$all_hds->{loopbacks}}; - @notebook = grep_index { - my $b = $_->{marked} or $notebook_widget->remove_page($::i); - $b; + my $i = 0; + @notebook = grep { + if ($_->{marked}) { + $i++; + 1; + } else { + $notebook_widget->remove_page($i); + 0; + } } @notebook; @notebook or $in->ask_warn(N("Error"), N("No hard disk drives found")), $in->exit(1); } -- cgit v1.2.1