Skip to content
Snippets Groups Projects
Commit 871b3f7f authored by Christophe Rhodes's avatar Christophe Rhodes
Browse files

Fix for punctuation in unix-string-common-casify

parent 3d5b72d2
No related branches found
No related tags found
No related merge requests found
...@@ -85,13 +85,15 @@ ...@@ -85,13 +85,15 @@
(pathname :initarg :pathname))) (pathname :initarg :pathname)))
(defmethod string-unix-common-casify (string &key (start 0) end) (defmethod string-unix-common-casify (string &key (start 0) end)
"Converts a string assumed local to a Unix filesystem into its
:common :case partner."
(unless end (unless end
(setf end (length string))) (setf end (length string)))
(let ((result (copy-seq string))) (let ((result (copy-seq string)))
(cond (cond
((every (lambda (x) (and (char>= x #\A) (char<= x #\Z))) (subseq string start end)) ((every (lambda (x) (or (not (alpha-char-p x)) (and (char>= x #\A) (char<= x #\Z)))) (subseq string start end))
(nstring-downcase result :start start :end end)) (nstring-downcase result :start start :end end))
((every (lambda (x) (and (char>= x #\a) (char<= x #\z))) (subseq string start end)) ((every (lambda (x) (or (not (alpha-char-p x)) (and (char>= x #\a) (char<= x #\z)))) (subseq string start end))
(nstring-upcase result :start start :end end)) (nstring-upcase result :start start :end end))
(t result)))) (t result))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment