From 3f47602cbbfdb31c59252008b5f2dbe91ca43d7f Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Wed, 9 Nov 2011 13:24:54 +0200 Subject: [PATCH] MAP-DIRECTORY didn't :CLASSIFY-SYMLINKS by default ...even though it said it did. Given foo/bar => ../src/bar src/bar/quux.asd now (directory "foo/*/*.asd") finds the .asd as expected. --- NEWS | 2 ++ src/code/filesys.lisp | 10 +++++----- tests/filesys.test.sh | 10 ++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index f79f635..9c29c28 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ changes relative to sbcl-1.0.53: * bug fix: on 64-bit targets, atomic-incf/aref does index computation correctly, even on wide-fixnum builds. (lp#887220) + * bug fix: (directory "foo/*/*.*") did not follow symlinks in foo/ that + resolved to directories. changes in sbcl-1.0.53 relative to sbcl-1.0.52: * enhancement: on 64-bit targets, in src/compiler/generic/early-vm.lisp, diff --git a/src/code/filesys.lisp b/src/code/filesys.lisp index c25818f..be6cc69 100644 --- a/src/code/filesys.lisp +++ b/src/code/filesys.lisp @@ -737,7 +737,7 @@ matching filenames." ;;; This is our core directory access interface that we use to implement ;;; DIRECTORY. (defun map-directory (function directory &key (files t) (directories t) - (classify-symlinks) (errorp t)) + (classify-symlinks t) (errorp t)) #!+sb-doc "Map over entries in DIRECTORY. Keyword arguments specify which entries to map over, and how: @@ -753,12 +753,12 @@ map over, and how: pathname. Defaults to T. :CLASSIFY-SYMLINKS - If T, the decision to call FUNCTION with the pathname of a symbolic link + If true, the decision to call FUNCTION with the pathname of a symbolic link depends on the resolution of the link: if it points to a directory, it is considered a directory entry, otherwise a file entry. If false, all - symbolic links are considered file entries. Defaults to T. In both cases - the pathname used for the symbolic link is not fully resolved, but names it - as an immediate child of DIRECTORY. + symbolic links are considered file entries. In both cases the pathname used + for the symbolic link is not fully resolved, but names it as an immediate + child of DIRECTORY. Defaults to T. :ERRORP If true, signal an error if DIRECTORY does not exist, cannot be read, etc. diff --git a/tests/filesys.test.sh b/tests/filesys.test.sh index a02e368..50f985d 100644 --- a/tests/filesys.test.sh +++ b/tests/filesys.test.sh @@ -206,6 +206,7 @@ mkdir foo touch foo/aa.txt touch foo/aa.tmp mkdir foo/x + mkdir far touch far/ab.txt touch far/ab.tmp @@ -213,11 +214,19 @@ mkdir far/x mkdir far/y mkdir far/y/x mkdir far/x/x + mkdir qar touch qar/ac.txt touch qar/ac.tmp + mkdir foo.moose touch foo.bar + +mkdir -p a/z c +touch a/z/foo.bar +touch a/z/foo.dummy +ln -s ../a/z c/z + run_sbcl <