Skip to content

Commit

Permalink
Fixed bug with read-until's implementation of the KMP algorithm.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
malisper committed Jul 24, 2015
1 parent 4f0789c commit 5a18c4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion url-rewrite/primitives.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ WRITE-THROUGH is true. On EOF the string read so far is returned."
;; OFFSETS
do (push (cons (char string (- mismatch i))
(1+ (- mismatch i)))
(svref offsets i))
(svref offsets mismatch))
finally (return offsets))))))
(collector (or skip
(make-array 0
Expand Down

0 comments on commit 5a18c4b

Please sign in to comment.