make/autoconf/basics.m4
changeset 58431 c8b0dcab20d7
parent 58270 2921ee5e9881
child 58549 9d9317fad3fe
--- a/make/autoconf/basics.m4	Tue Oct 01 07:37:39 2019 -0700
+++ b/make/autoconf/basics.m4	Tue Oct 01 08:11:02 2019 -0700
@@ -213,8 +213,10 @@
   if test "x[$]$1" != x; then
     new_path="[$]$1"
 
-    if [ [[ "$new_path" = ~* ]] ]; then
-      # Use eval to expand a potential ~
+    # Use eval to expand a potential ~. This technique does not work if there
+    # are spaces in the path (which is valid at this point on Windows), so only
+    # try to apply it if there is an actual ~ first in the path.
+    if [ [[ "$new_path" = "~"* ]] ]; then
       eval new_path="$new_path"
       if test ! -f "$new_path" && test ! -d "$new_path"; then
         AC_MSG_ERROR([The new_path of $1, which resolves as "$new_path", is not found.])