From: simonmar Date: Mon, 13 Jan 2003 11:32:00 +0000 (+0000) Subject: [project @ 2003-01-13 11:32:00 by simonmar] X-Git-Tag: nhc98-1-18-release~762 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=604586274bdc939aa110379d56b92830651dc322;p=ghc-base.git [project @ 2003-01-13 11:32:00 by simonmar] Fix off-by-one in splitWithPS. Noticed-by: Tomasz Zielonka MERGE TO STABLE --- diff --git a/Data/PackedString.hs b/Data/PackedString.hs index da0206a..f82b756 100644 --- a/Data/PackedString.hs +++ b/Data/PackedString.hs @@ -248,7 +248,7 @@ splitWithPS pred (PS ps) = : splitify (break_pt + 1) first_pos_that_satisfies pred ps len n = - case [ m | m <- [n..len], pred (ps ! m) ] of + case [ m | m <- [n..len-1], pred (ps ! m) ] of [] -> len (m:_) -> m