Skip to content

Commit 5a18c4b

Browse files
committed
Fixed bug with read-until's implementation of the KMP algorithm.
The KMP algorithm works by building a table which keeps track of which characters in the search string can be skipped when a mismatch occurs. This information is supposed to be maintained in the index of the mismatch. Read-until had previously built the table incorrectly and placed that information in the wrong place.
1 parent 4f0789c commit 5a18c4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

url-rewrite/primitives.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ WRITE-THROUGH is true. On EOF the string read so far is returned."
120120
;; OFFSETS
121121
do (push (cons (char string (- mismatch i))
122122
(1+ (- mismatch i)))
123-
(svref offsets i))
123+
(svref offsets mismatch))
124124
finally (return offsets))))))
125125
(collector (or skip
126126
(make-array 0

0 commit comments

Comments
 (0)