Commit 7fc0d5c0 authored by Nikodemus Siivola's avatar Nikodemus Siivola

fix starts-with-subseq :start1 and :start2

parent e1da77b0
......@@ -289,7 +289,7 @@ displaced array pointing to the sequence after PREFIX."
(let ((sequence-length (length sequence))
(prefix-length (length prefix)))
(if (<= prefix-length sequence-length)
(let ((mismatch (apply #'mismatch sequence prefix args)))
(let ((mismatch (apply #'mismatch prefix sequence args)))
(if mismatch
(if (< mismatch prefix-length)
(values nil nil)
......
......@@ -1852,3 +1852,13 @@
(incf n))
n)
13)
(deftest starts-with-subseq.start1
(starts-with-subseq "foo" "oop" :start1 1)
t
nil)
(deftest starts-with-subseq.start2
(starts-with-subseq "foo" "xfoop" :start2 1)
t
nil)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment