From 5a5a40801b45059074f6498085f98ffea9ab6f0a Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 19 Jan 1995 19:41:55 +0000 Subject: [PATCH] Fix bug in presentation of pathnames to user -- if the pathname being presented is on a different device from the default, ENOUGH-PATHNAME cannot be used. This is because ENOUGH-PATHNAME and MERGE-PATHNAMES treat the device as separate from the directory, whereas Edwin wants the device to be considered as part of the directory. --- v7/src/edwin/os2.scm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/v7/src/edwin/os2.scm b/v7/src/edwin/os2.scm index 68503e4e0..68d8fb965 100644 --- a/v7/src/edwin/os2.scm +++ b/v7/src/edwin/os2.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: os2.scm,v 1.3 1995/01/16 20:40:09 cph Exp $ +;;; $Id: os2.scm,v 1.4 1995/01/19 19:41:55 cph Exp $ ;;; ;;; Copyright (c) 1994-95 Massachusetts Institute of Technology ;;; @@ -91,10 +91,15 @@ Includes the new backup. Must be > 0." (else (string-tail string start)))))) (define (os/pathname->display-string pathname) - (let ((pathname (enough-pathname pathname (user-homedir-pathname)))) - (if (pathname-absolute? pathname) - (->namestring pathname) - (string-append "~\\" (->namestring pathname))))) + (let ((homedir (user-homedir-pathname))) + (if (let ((d1 (pathname-device pathname)) + (d2 (pathname-device homedir))) + (and d1 d2 (string-ci=? d1 d2))) + (let ((pathname (enough-pathname pathname homedir))) + (if (pathname-absolute? pathname) + (->namestring pathname) + (string-append "~\\" (->namestring pathname)))) + (->namestring pathname)))) (define (os/truncate-filename-for-modeline filename width) (let ((length (string-length filename))) -- 2.25.1