From c27c9c016c31b8f1603b90f5aec42e2f3f7adf15 Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Tue, 28 Jul 1992 19:43:18 +0000 Subject: [PATCH] Handle screwy directories with dots in their names. --- v7/src/runtime/dospth.scm | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/v7/src/runtime/dospth.scm b/v7/src/runtime/dospth.scm index 0738b8f7e..2b9360eda 100644 --- a/v7/src/runtime/dospth.scm +++ b/v7/src/runtime/dospth.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/dospth.scm,v 1.6 1992/07/28 16:20:26 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/dospth.scm,v 1.7 1992/07/28 19:43:18 jinx Exp $ Copyright (c) 1992 Massachusetts Institute of Technology @@ -113,12 +113,24 @@ MIT in each case. |# directory)) (define (parse-directory-component component) - (cond ((string=? ".." component) - 'UP) - ((> (string-length component) 8) - (substring component 0 8)) - (else - component))) + (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. + (parse-name component + (lambda (before after) + (string-append (if (eq? before 'WILD) + "*" + before) + "." + (if (eq? after 'WILD) + "*" + after))))) + ((> len 8) + (substring component 0 8)) + (else + component))))) (define (expand-directory-prefixes string) (if (string-null? string) -- 2.25.1