small runshell optimisation
authorJoey Hess <joeyh@joeyh.name>
Mon, 5 Oct 2020 17:37:00 +0000 (13:37 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 5 Oct 2020 17:37:00 +0000 (13:37 -0400)
avoid some test -d for locale variables that are not set

standalone/linux/skel/runshell

index b3683dd46d01f90e0b3bb84cfb89e56c6d9891bf..3c60ce1e4314aa20bd60d16c7d92fe61fc57aba8 100755 (executable)
@@ -168,7 +168,7 @@ if [ -z "${LOCPATH+set}" ] && [ -z "$GIT_ANNEX_PACKAGE_INSTALL" ]; then
                        "$LC_COLLATE" "$LC_MONETARY" "$LC_MESSAGES" "$LC_PAPER" \
                        "$LC_NAME" "$LC_ADDRESS" "$LC_TELEPHONE" "$LC_MEASUREMENT" \
                        "$LC_IDENTIFICATION" "$LC_ALL"; do
-               if [ "$localeenv" != "$lastlocaleenv" ]; then
+               if [ -n "$localeenv" ] && [ "$localeenv" != "$lastlocaleenv" ]; then
                        lastlocaleenv="$localeenv"
                        if [ ! -d "$LOCPATH/$localeenv" ]; then
                                if [ "${localeenv##[!.]*.}" = "utf8" ] || [ "${localeenv##[!.]*.}" = "UTF-8" ]; then