From: Chris Hanson Date: Sat, 2 Jun 2001 21:57:16 +0000 (+0000) Subject: PROMPT-FOR-DIRECTORY should not always perform PATHNAME-AS-DIRECTORY X-Git-Tag: 20090517-FFI~2743 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=27ef16e33946aca2bf56e31e2b8de1f550485790;p=mit-scheme.git PROMPT-FOR-DIRECTORY should not always perform PATHNAME-AS-DIRECTORY on its result; if the REQUIRE-MATCH? option isn't given, the result might not be a directory. For example, Dired uses this prompt, and an input with a wildcard file part is permissible. --- diff --git a/v7/src/edwin/filcom.scm b/v7/src/edwin/filcom.scm index 1ad5b6cc3..4a204a48e 100644 --- a/v7/src/edwin/filcom.scm +++ b/v7/src/edwin/filcom.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: filcom.scm,v 1.217 2001/05/12 20:02:19 cph Exp $ +;;; $Id: filcom.scm,v 1.218 2001/06/02 21:57:16 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-2001 Massachusetts Institute of Technology ;;; @@ -743,8 +743,15 @@ Prefix arg means treat the plaintext file as binary data." (define (prompt-for-directory prompt default . options) (->namestring - (pathname-as-directory - (prompt-for-pathname* prompt default file-directory-not-wild? options)))) + (let ((directory + (prompt-for-pathname* prompt default file-directory-not-wild? + options))) + ;; Don't convert the result to directory form unless it is known + ;; to be a directory. If REQUIRE-MATCH? is false, it is allowed + ;; to specify a file part. + (if (file-test-no-errors file-directory-not-wild? directory) + (pathname-as-directory directory) + directory)))) (define (prompt-for-existing-directory prompt default . options) (->namestring