From 1393bb0305bb80dfd5ebe57268b55e7d0dfa8567 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 8 Jun 2021 13:25:21 -0700 Subject: FILE:DIRECTORY-DOES-NOT-EXIST: simplify not deleting non-dirs Signed-off-by: Sean Whitton --- src/util.lisp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/util.lisp') diff --git a/src/util.lisp b/src/util.lisp index 9dd417d..1dd2b44 100644 --- a/src/util.lisp +++ b/src/util.lisp @@ -167,6 +167,11 @@ one solution is to convert your property to a :LISP property." (namestring (enough-pathname pathname (pathname-directory-pathname pathname))))) +(defun ensure-trailing-slash (namestring) + (if (string-suffix-p namestring "/") + namestring + (strcat namestring "/"))) + (defun drop-trailing-slash (namestring) (if (string-suffix-p namestring "/") (subseq namestring 0 (1- (length namestring))) -- cgit v1.2.3