]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
setup.sh: fix setup if LD_PRELOAD is not set
authorSimon Ruderich <simon@ruderich.org>
Wed, 10 Sep 2014 12:19:19 +0000 (14:19 +0200)
committerSimon Ruderich <simon@ruderich.org>
Wed, 10 Sep 2014 12:19:19 +0000 (14:19 +0200)
setup.sh

index 3f49ad598c597b31aca0bc8837c919cc2ec6dd86..3064adec21b6765a46567c7c93abb6dd83beaf5d 100755 (executable)
--- a/setup.sh
+++ b/setup.sh
@@ -49,7 +49,8 @@ if installed git; then
     fi
     # If coloredstderr is used to color stderr then remove the workaround for
     # missing output to stderr.
-    if printf '%s' "$LD_PRELOAD" | grep libcoloredstderr.so >/dev/null; then
+    if test -n "${LD_PRELOAD:+set}" \
+            && printf '%s' "$LD_PRELOAD" | grep libcoloredstderr.so >/dev/null; then
         echo 'gitconfig: removing stderr fix'
         sed_i '/^\t\(fs\|fg\)  =/ s/2>&1//' gitconfig
     fi