Skip to content

Commit

Permalink
use Donald's code in 'sub get_chosen'
Browse files Browse the repository at this point in the history
bringing the white spaces back
  • Loading branch information
david committed Sep 26, 2017
1 parent 4cb8dff commit 0d4e217
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions mxgrub/mxgrub
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,7 @@ sub get_chosen {
my $chosen;
open my $p,'-|','grub-editenv','-','list' or die "$!\n";
while (<$p>) {
/^chosen=$submenu>(.+)/;
if (defined $1) {
return $1;
} else {
/^chosen=(.+)/ and return $1;
}

/^chosen=(?:$submenu>)?(.+)/ and return $1;
}
close $p or die "$!\n";
$? and exit 1;
Expand Down Expand Up @@ -198,10 +192,10 @@ menuentry "$MARIUX_DEFAULT" --unrestricted { set chosen="$submenu>$MARIUX_DEFAUL
submenu "$submenu" --unrestricted {
$kernellist
}
if [ \$chosen ]; then
set default=\$chosen
unset chosen # must be clear to get a clean value from menuentry
fi
if [ \$chosen ]; then
set default=\$chosen
unset chosen # must be clear to get a clean value from menuentry
fi
fi
EOF

Expand Down

0 comments on commit 0d4e217

Please sign in to comment.