From a2ce53a676e212b383b21d1539a20305ab3c7365 Mon Sep 17 00:00:00 2001 From: Mark Friedman Date: Fri, 10 Nov 1989 16:18:42 +0000 Subject: [PATCH] Fixed os/trim-pathname-string() to have "end" point to the end of the string, not to one past the end. The old behavior caused it to barf when presented with a string with a slash at the end (it barfed on the string-ref in "... ((memv ..." --- v7/src/edwin/unix.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/v7/src/edwin/unix.scm b/v7/src/edwin/unix.scm index f22d0a51a..3f5f81e58 100644 --- a/v7/src/edwin/unix.scm +++ b/v7/src/edwin/unix.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/unix.scm,v 1.10 1989/08/12 08:32:36 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/unix.scm,v 1.11 1989/11/10 16:18:42 markf Rel $ ;;; ;;; Copyright (c) 1989 Massachusetts Institute of Technology ;;; @@ -47,7 +47,8 @@ (declare (usual-integrations)) (define (os/trim-pathname-string string) - (let ((end (string-length string))) (let loop ((index end)) + (let ((end (-1+ (string-length string)))) + (let loop ((index end)) (let ((slash (substring-find-previous-char string 0 index #\/))) (cond ((or (not slash) (= slash end)) string) -- 2.25.1