~ chicken-core (chicken-5) e1d04cff95ecc7ba1c7a556e9abc98ef6d376dd0


commit e1d04cff95ecc7ba1c7a556e9abc98ef6d376dd0
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Thu Aug 4 06:26:10 2011 -0400
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Thu Aug 4 06:26:10 2011 -0400

    allows use of parameterize with current-directory (reported by Sven Hartrumpf)

diff --git a/posix-common.scm b/posix-common.scm
index 3892b875..a1f6790c 100644
--- a/posix-common.scm
+++ b/posix-common.scm
@@ -229,19 +229,18 @@ EOF
 
 ;;; Set or get current directory:
 
-(define current-directory
-  (lambda (#!optional dir)
-    (if dir
-	(change-directory dir)
-	(let* ((buffer (make-string 1024))
-	       (len (##core#inline "C_curdir" buffer)) )
-	  #+(or unix cygwin)
-	  (##sys#update-errno)
-	  (if len
-	      (##sys#substring buffer 0 len)
-	      (##sys#signal-hook
-	       #:file-error
-	       'current-directory "cannot retrieve current directory") ) ) ) ) )
+(define (current-directory #!optional dir mode) ; for "parameterize"
+  (if dir
+      (change-directory dir)
+      (let* ((buffer (make-string 1024))
+	     (len (##core#inline "C_curdir" buffer)) )
+	#+(or unix cygwin)
+	(##sys#update-errno)
+	(if len
+	    (##sys#substring buffer 0 len)
+	    (##sys#signal-hook
+	     #:file-error
+	     'current-directory "cannot retrieve current directory") ) ) ) )
 
 (define delete-directory
   (lambda (name #!optional recursive)
Trap