In file-name-{sans-}extension, check whether the rightmost "." occurs within a directory name.
This commit is contained in:
parent
87a29c59ab
commit
c223eded17
|
@ -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))))
|
||||
|
|
Loading…
Reference in New Issue