#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/dospth.scm,v 1.13 1992/08/14 03:50:58 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/dospth.scm,v 1.14 1992/08/14 04:15:56 jinx Exp $
Copyright (c) 1992 Massachusetts Institute of Technology
directory))
\f
(define (parse-directory-component component)
- (define (->field field)
- (cond ((eq? field 'WILD)
- "*")
- ((not field)
- "")
- ((not (string? field))
- (error "->field: Unknown field" field))
- (else
- field)))
-
(if (string=? ".." component)
'UP
(let ((len (string-length component)))
(cond ((substring-find-previous-char component 0 len #\.)
;; Handle screwy directories with dots in their names.
- =>
- (lambda (posn)
- (parse-name component
- (lambda (before after)
- (let ((before (->field before)))
- (if (string=? before component)
- component
- (string-append before
- "."
- (->field after))))))))
+ (parse-name component unparse-name))
((> len 8)
(substring component 0 8))
(else