diff --git a/mxgrub/mxgrub b/mxgrub/mxgrub index f43fb843..df0aeeab 100755 --- a/mxgrub/mxgrub +++ b/mxgrub/mxgrub @@ -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; @@ -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