DRAFT mes: Fix basename.

* mes/module/mes/posix.mes (basename): Take first element instead of last.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2022-03-23 14:12:48 +01:00
parent c673b5cc37
commit 05b9103552
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@
(define S_IRWXU #o700)
(define (basename file-name . ext)
(let ((base (last (string-split file-name #\/)))
(let ((base (car (last-pair (string-split file-name #\/))))
(ext (and (pair? ext) (car ext))))
(if (and ext
(string-suffix? ext base)) (string-drop-right base (string-length ext))