~ chicken-core (master) d6d151d189664f97756361b9b3255b9cbea819bf


commit d6d151d189664f97756361b9b3255b9cbea819bf
Author:     Mario Domenech Goulart <mario@parenteses.org>
AuthorDate: Sat Jul 18 00:06:28 2026 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Sun Jul 19 19:35:31 2026 +0200

    bootstrap.sh: Unset CDPATH
    
    When cd is given as argument a directory that cannot be found in the
    paths yielded by CDPATH on OpenBSD's ksh (same binary as /bin/sh), it
    fails with
    
      `sh: cd: <the dir>: bad directory'
    
    Here's an example to illustrate the problem:
    
      $ echo $CDPATH
      /home/mario/.marks
    
      $ mkdir foo; echo $?
      0
    
      $ cd foo
      sh: cd: foo: bad directory
    
      $ unset CDPATH; echo $?
      0
    
      $ cd foo; pwd
      /home/mario/tmp/foo
    
    The same can be observed with bootstrap.sh:
    
      $ cd ~/src/chicken-core
      $ ./scripts/bootstrap.sh
      ./scripts/bootstrap.sh[23]: cd: boot: bad directory
    
    Fix that in bootstrap.sh by unsetting CDPATH.
    
    Signed-off-by: felix <felix@call-with-current-continuation.org>

diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 49c978f9..34a21533 100755
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -2,6 +2,13 @@
 
 set -e
 
+# When cd is given as argument a directory that cannot be found in the
+# paths yielded by CDPATH on OpenBSD's ksh (same binary as sh), it
+# fails with
+#     `sh: cd: <the dir>: bad directory'
+# So, we unset CDPATH to avoid such problems.
+unset CDPATH
+
 BOOTVERSION=6.0.0rc3
 BOOTURL=2026/05/12/chicken-${BOOTVERSION}.tar.gz
 
Trap