Skip to content
Snippets Groups Projects
Commit 3dbbb562 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Fix omission while renaming SPLIT to SPLIT-STRING.

parent 4ddaabe8
No related branches found
No related tags found
No related merge requests found
...@@ -531,18 +531,19 @@ return a list. ...@@ -531,18 +531,19 @@ return a list.
If MAX is specified, then no more than max(1,MAX) components will be returned, If MAX is specified, then no more than max(1,MAX) components will be returned,
starting the separation from the end, e.g. when called with arguments starting the separation from the end, e.g. when called with arguments
\"a.b.c.d.e\" :max 3 :separator \".\" it will return (\"a.b.c\" \"d\" \"e\")." \"a.b.c.d.e\" :max 3 :separator \".\" it will return (\"a.b.c\" \"d\" \"e\")."
(let ((list nil) (words 0) (end (length string))) (block nil
(flet ((separatorp (char) (find char separator)) (let ((list nil) (words 0) (end (length string)))
(done () (return-from split (cons (subseq string 0 end) list)))) (flet ((separatorp (char) (find char separator))
(loop (done () (return (cons (subseq string 0 end) list))))
:for start = (if (and max (>= words (1- max))) (loop
(done) :for start = (if (and max (>= words (1- max)))
(position-if #'separatorp string :end end :from-end t)) :do (done)
(when (null start) (position-if #'separatorp string :end end :from-end t)) :do
(done)) (when (null start)
(push (subseq string (1+ start) end) list) (done))
(incf words) (push (subseq string (1+ start) end) list)
(setf end start))))) (incf words)
(setf end start))))))
(defun split-name-type (filename) (defun split-name-type (filename)
(destructuring-bind (name &optional type) (destructuring-bind (name &optional type)
......
...@@ -55,8 +55,10 @@ do_tests() { ...@@ -55,8 +55,10 @@ do_tests() {
command=$1 eval=$2 fasl_ext=$3 command=$1 eval=$2 fasl_ext=$3
rm -f *.$fasl_ext ~/.cache/common-lisp/"`pwd`"/*.$fasl_ext || true rm -f *.$fasl_ext ~/.cache/common-lisp/"`pwd`"/*.$fasl_ext || true
( cd .. && $command $eval '(load "test/compile-asdf.lisp")' ) ( cd .. && $command $eval '(load "test/compile-asdf.lisp")' )
if [ $? -eq 0 ] ; then if [ $? -ne 0 ] ; then
echo "Compiled OK" echo "Compilation FAILED" >&2
else
echo "Compiled OK" >&2
test_count=0 test_count=0
test_pass=0 test_pass=0
test_fail=0 test_fail=0
......
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