mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-27 09:01:37 +00:00
(cherry picked from commit 0944b0f441)
This commit is contained in:
@@ -97,7 +97,7 @@ proc bufSubstr(b: cstring, sPos, ePos: int): string {.inline.} =
|
||||
## Don't assume cstring is '\0' terminated
|
||||
let sz = ePos - sPos
|
||||
result = newString(sz+1)
|
||||
copyMem(addr(result[0]), unsafeaddr(b[sPos]), sz)
|
||||
copyMem(addr(result[0]), unsafeAddr(b[sPos]), sz)
|
||||
result.setLen(sz)
|
||||
|
||||
proc matchOrFind(buf: cstring, pattern: Regex, matches: var openArray[string],
|
||||
|
||||
Reference in New Issue
Block a user