mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-02 03:02:31 +00:00
Fix upper bound handling
This commit is contained in:
@@ -301,10 +301,12 @@ proc matchImpl(str: string, pattern: Regex, start, endpos: int, flags: int): Reg
|
||||
result.pcreMatchBounds = newSeq[Slice[cint]](ceil(vecsize / 2).int)
|
||||
result.pcreMatchBounds.setLen(vecsize div 3)
|
||||
|
||||
let strlen = if endpos == -1: str.len else: endpos
|
||||
|
||||
let execRet = pcre.exec(pattern.pcreObj,
|
||||
pattern.pcreExtra,
|
||||
cstring(str),
|
||||
cint(max(str.len, endpos)),
|
||||
cint(strlen),
|
||||
cint(start),
|
||||
cint(flags),
|
||||
cast[ptr cint](addr result.pcreMatchBounds[0]),
|
||||
|
||||
Reference in New Issue
Block a user