summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-03-13 11:36:03 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-03-13 11:36:03 +0000
commit2dd04e7992014e0240f4ebd5e1f8cc7db94df000 (patch)
treecea4f6a7d036c526e87b3cff6bc3bb961a827239
parent6a72c4dceb2224ab1de62ebbf1e47c3849802436 (diff)
downloaddrakx-2dd04e7992014e0240f4ebd5e1f8cc7db94df000.tar
drakx-2dd04e7992014e0240f4ebd5e1f8cc7db94df000.tar.gz
drakx-2dd04e7992014e0240f4ebd5e1f8cc7db94df000.tar.bz2
drakx-2dd04e7992014e0240f4ebd5e1f8cc7db94df000.tar.xz
drakx-2dd04e7992014e0240f4ebd5e1f8cc7db94df000.zip
don't die when we have no entries in grub menu.lst
-rw-r--r--perl-install/bootloader.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 73f93cb3f..759b4833b 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -245,8 +245,10 @@ sub read_grub {
$b{nowarn} = 1;
# handle broken installkernel -r:
- $b{default} = min($b{default}, scalar(@{$b{entries}}) - 1);
- $b{default} = $b{entries}[$b{default}]{label};
+ if (@{$b{entries}}) {
+ $b{default} = min($b{default}, scalar(@{$b{entries}}) - 1);
+ $b{default} = $b{entries}[$b{default}]{label};
+ }
$b{method} = 'grub';
\%b;