From: Mark Friedman Date: Fri, 10 Nov 1989 16:18:42 +0000 (+0000) Subject: Fixed os/trim-pathname-string() to have "end" point to the end of the X-Git-Tag: 20090517-FFI~11692 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=a2ce53a676e212b383b21d1539a20305ab3c7365;p=mit-scheme.git 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 ..." --- 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)