From: Chris Hanson Date: Wed, 18 Oct 1995 05:00:46 +0000 (+0000) Subject: Change definition of DIRECTORY-PATHNAME-AS-FILE so that it does X-Git-Tag: 20090517-FFI~5886 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=58d89093a9cc4fe961aafb996b35640e17b06d5c;p=mit-scheme.git Change definition of DIRECTORY-PATHNAME-AS-FILE so that it does nothing when the argument is already in "file" form. This makes it a true inverse to PATHNAME-AS-DIRECTORY. --- diff --git a/v7/src/runtime/dospth.scm b/v7/src/runtime/dospth.scm index 0035a976c..ff5093e23 100644 --- a/v7/src/runtime/dospth.scm +++ b/v7/src/runtime/dospth.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: dospth.scm,v 1.29 1995/09/11 21:25:45 cph Exp $ +$Id: dospth.scm,v 1.30 1995/10/18 05:00:30 cph Exp $ Copyright (c) 1992-95 Massachusetts Institute of Technology @@ -300,13 +300,10 @@ MIT in each case. |# (or (eq? 'ABSOLUTE (car directory)) (pair? (cdr directory))))) (error:bad-range-argument pathname 'DIRECTORY-PATHNAME-AS-FILE)) - (if (null? (cdr directory)) - (%%make-pathname (%pathname-host pathname) - (%pathname-device pathname) - directory - "" - #f - 'UNSPECIFIC) + (if (or (%pathname-name pathname) + (%pathname-type pathname) + (null? (cdr directory))) + pathname (call-with-values (lambda () (parse-name diff --git a/v7/src/runtime/unxpth.scm b/v7/src/runtime/unxpth.scm index cb4ae439f..167662d37 100644 --- a/v7/src/runtime/unxpth.scm +++ b/v7/src/runtime/unxpth.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: unxpth.scm,v 14.19 1995/09/11 19:07:16 cph Exp $ +$Id: unxpth.scm,v 14.20 1995/10/18 05:00:46 cph Exp $ Copyright (c) 1988-95 Massachusetts Institute of Technology @@ -240,7 +240,9 @@ MIT in each case. |# (or (eq? 'ABSOLUTE (car directory)) (pair? (cdr directory))))) (error:bad-range-argument pathname 'DIRECTORY-PATHNAME-AS-FILE)) - (if (null? (cdr directory)) + (if (or (%pathname-name pathname) + (%pathname-type pathname) + (null? (cdr directory))) ;; Root directory can't be represented as a file, because the ;; name field of a pathname must be a non-null string. We ;; could signal an error here, but instead we'll just return