Revert "Fixes #12187 (#12321)" (#12447)

This reverts commit 00c31e8766.
This commit is contained in:
Andreas Rumpf 2019-10-18 15:59:22 +02:00 • committed by GitHub
commit 889b745b2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 21 additions and 44 deletions

View file

@ -1872,7 +1872,7 @@ proc find*(s: string, sub: char, start: Natural = 0, last = 0): int {.noSideEffe
when hasCStringBuiltin:
let L = last-start+1
if L > 0:
let found = c_memchr(s[start].unsafeAddr, sub, csize L)
let found = c_memchr(s[start].unsafeAddr, sub, L)
if not found.isNil:
return cast[ByteAddress](found) -% cast[ByteAddress](s.cstring)
else: