It's important to make sure the theme name is properly
quoted when passed to the basename command. This
is because, if the theme name is empty we want the empty
string returned, not the suffix that would otherwise be
stripped off.
Some discussion here:
https://bugzilla.redhat.com/show_bug.cgi?id=606634
{
for theme in ${PLYMOUTH_DATADIR}/plymouth/themes/*/*.plymouth; do
[ -f $theme ] || continue;
- echo "$(basename $theme .plymouth)"
+ echo "$(basename "$theme" .plymouth)"
done
}
if [ -z "$THEME_NAME" -o ! -r "${PLYMOUTH_DATADIR}/plymouth/themes/$THEME_NAME/$THEME_NAME.plymouth" \
-a -L "${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth" ]; then
- THEME_NAME=$(basename $(readlink ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth) .plymouth)
+ THEME_NAME=$(basename "$(readlink ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth)" .plymouth)
fi
if [ -z "$THEME_NAME" -o ! -r "${PLYMOUTH_DATADIR}/plymouth/themes/$THEME_NAME/$THEME_NAME.plymouth" ]; then
THEME_NAME="text"