]> git.notmuchmail.org Git - notmuch/commitdiff
configure: Drop global setting of IFS (without space in it).
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 26 Jan 2011 13:13:21 +0000 (23:13 +1000)
committerCarl Worth <cworth@cworth.org>
Wed, 26 Jan 2011 13:29:03 +0000 (23:29 +1000)
This was originally intended to help support filenames with spaces in
them, but this actually breaks things when someone sets a command with
a space in it, (such as CC="ccache cc").

Instead, we now only set a custom IFS when acting on the
newline-separated list of files from /sbin/ldconfig.

configure

index c7ec4145afb37518d2d2155911f86ef61effece2..3d1efb0bf7b84116c1fbdf70c4f3eec9dbf3b201 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,13 +1,5 @@
 #! /bin/sh
 
 #! /bin/sh
 
-# Removing space from IFS makes it much easier to support filenames
-# with spaces. See http://www.dwheeler.com/essays/filenames-in-shell.html
-# for gory details.
-IFS="$(printf '\n\t')"
-
-# Since we don't have space in IFS we use tab to separate things in lists
-tab="$(printf '\t')"
-
 # Set several defaults (optionally specified by the user in
 # environemnt variables)
 CC=${CC:-gcc}
 # Set several defaults (optionally specified by the user in
 # environemnt variables)
 CC=${CC:-gcc}
@@ -343,11 +335,16 @@ elif [ $uname = "Linux" ] ; then
     platform=LINUX
     linker_resolves_library_dependencies=1
     ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')
     platform=LINUX
     linker_resolves_library_dependencies=1
     ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')
+    # Separate ldconfig_paths only on newline (not on any potential
+    # embedded space characters in any filenames).
+    OLD_IFS=$IFS
+    IFS="$(printf '\n')"
     for path in $ldconfig_paths; do
        if [ "$path" = "$libdir_expanded" ]; then
            libdir_in_ldconfig=1
        fi
     done
     for path in $ldconfig_paths; do
        if [ "$path" = "$libdir_expanded" ]; then
            libdir_in_ldconfig=1
        fi
     done
+    IFS=$OLD_IFS
 else
     printf "Unknown.\n"
     cat <<EOF
 else
     printf "Unknown.\n"
     cat <<EOF