Fixed os/trim-pathname-string() to have "end" point to the end of the
authorMark Friedman <edu/mit/csail/zurich/markf>
Fri, 10 Nov 1989 16:18:42 +0000 (16:18 +0000)
committerMark Friedman <edu/mit/csail/zurich/markf>
Fri, 10 Nov 1989 16:18:42 +0000 (16:18 +0000)
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

index f22d0a51afd567916004281a7e2f40031281356c..3f5f81e580b679938f815f8e05017852be55ac39 100644 (file)
@@ -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))
 \f
 (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)