summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Jerrick <bmj001@gmail.com>2010-07-06 11:13:38 -0400
committerRay Strode <rstrode@redhat.com>2010-07-06 11:16:43 -0400
commit95bf9eed86b4bf267bcd77774ee37c08dc5b9162 (patch)
tree1c9b24b00f7823d5f94ed42390111ac73c29f088
parent0e232e29765cade22b9e8cba3b0c372eb4db58f9 (diff)
[set-default-theme] Properly quote arguments to basename
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
-rwxr-xr-xscripts/plymouth-set-default-theme.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/plymouth-set-default-theme.in b/scripts/plymouth-set-default-theme.in
index 105cdd80..d9b0f016 100755
--- a/scripts/plymouth-set-default-theme.in
+++ b/scripts/plymouth-set-default-theme.in
@@ -38,7 +38,7 @@ function list_themes ()
{
for theme in ${PLYMOUTH_DATADIR}/plymouth/themes/*/*.plymouth; do
[ -f $theme ] || continue;
- echo "$(basename $theme .plymouth)"
+ echo "$(basename "$theme" .plymouth)"
done
}
@@ -65,7 +65,7 @@ function get_default_theme ()
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"