Skip to content

Commit

Permalink
grub-btrfs: sanitize title menu entries
Browse files Browse the repository at this point in the history
Closes #198

Signed-off-by: Pascal Jäger <[email protected]>
  • Loading branch information
Schievel1 committed Nov 20, 2022
1 parent 57687ac commit b2b5307
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 41_snapshots-btrfs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ fi
## Create entry
entry()
{
echo "$@" >> "$grub_directory/grub-btrfs.new"
echo "$@" >> "$grub_directory/grub-btrfs.new"
}

## menu entries
Expand Down Expand Up @@ -453,6 +453,7 @@ title_format()
if [[ "${#var}" -lt "${#title_column[${GRUB_BTRFS_TITLE_FORMAT[$key],,}]}" ]]; then # Add extra spaces if length of $var is smaller than the length of column, needed for pretty formatting
printf -v var "%-$(((${#title_column[${GRUB_BTRFS_TITLE_FORMAT[$key],,}]}-${#var})+${#var}))s" "${var}";
fi
var="$(sed "s/'//g" <(echo "${var}"))"
title_menu+="${var}|"
title_submenu+=" $(trim "${var}") |"
done
Expand Down

0 comments on commit b2b5307

Please sign in to comment.