planime: Fixed proper quoting of basename.
authorFredrik Tolf <fredrik@dolda2000.com>
Fri, 20 May 2011 03:23:35 +0000 (05:23 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Fri, 20 May 2011 03:23:35 +0000 (05:23 +0200)
planime

diff --git a/planime b/planime
index 9c17459..a25761e 100755 (executable)
--- a/planime
+++ b/planime
@@ -19,7 +19,7 @@ findfile() {
     local file tail eq eqt m matches max score
     matches=()
     for file in "$1"*; do
     local file tail eq eqt m matches max score
     matches=()
     for file in "$1"*; do
-       tail="${file#$1}"
+       tail="${file#"$1"}"
        eq="${tail%.*}"
        m=n
        if [ "${eq%% *}" -eq "$2" ] 2>/dev/null; then
        eq="${tail%.*}"
        m=n
        if [ "${eq%% *}" -eq "$2" ] 2>/dev/null; then