In file-name-{sans-}extension, check whether the rightmost "." occurs within a directory name.

This commit is contained in:
mainzelm 2003-02-10 07:26:18 +00:00
parent 87a29c59ab
commit c223eded17
1 changed files with 3 additions and 1 deletions

View File

@ -128,9 +128,11 @@
;;; /usr/shivers/.login are not considered extensions.
(define (file-name-extension-index fname)
(let ((dot (string-index-right fname #\.)))
(let ((dot (string-index-right fname #\.))
(slash (string-index-right fname #\/)))
(if (and dot
(> dot 0)
(if slash (> dot slash) #t)
(not (char=? #\/ (string-ref fname (- dot 1)))))
dot
(string-length fname))))