aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorTomi Ollila <tomi.ollila@iki.fi>2019-09-01 23:09:46 +0300
committerDavid Bremner <david@tethera.net>2019-09-11 18:51:23 -0300
commite0e55c5b6fd27a96601de95cfcec2b67d8a20c76 (patch)
tree7d21f9a9ced164ab92481bbd2757550b646445dc /configure
parent9829533e92f84ff151279e5202e0420bc70a8863 (diff)
configure: disallow whitespace in paths, extend checks to $PWD
Whitespace in $NOTMUCH_SRCDIR (and $PWD) may work in builds, but definitely will not work in tests. It would be difficult to make tests support whitespace in test filename paths -- and fragile to maintain if done. So it is just easier and safer to disallow whitespace there. In case of out of tree build $NOTMUCH_SRCDIR differs from $PWD (current directory). Extend this whitespace, and also previously made unsafe characters check to $PWD too.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure b/configure
index ef81e71b..3c148e12 100755
--- a/configure
+++ b/configure
@@ -31,6 +31,22 @@ case $NOTMUCH_SRCDIR in ( *\'* | *['\"`$']* )
exit 1
esac
+case $PWD in ( *\'* | *['\"`$']* )
+ echo "Definitely unsafe characters in current directory '$PWD'".
+ exit 1
+esac
+
+# In case of whitespace, builds may work, tests definitely will not.
+case $NOTMUCH_SRCDIR in ( *["$IFS"]* )
+ echo "Whitespace in source path '$NOTMUCH_SRCDIR' not supported".
+ exit 1
+esac
+
+case $PWD in ( *["$IFS"]* )
+ echo "Whitespace in current directory '$PWD' not supported".
+ exit 1
+esac
+
subdirs="util compat lib parse-time-string completion doc emacs"
subdirs="${subdirs} performance-test test test/test-databases"
subdirs="${subdirs} bindings"