fixes a long standing string steams bug that caused lexbase to misbehave
This commit is contained in:
parent
55c244400d
commit
0915399b50
1 changed files with 4 additions and 0 deletions
|
|
@ -334,12 +334,16 @@ when not defined(js):
|
|||
if result > 0:
|
||||
copyMem(buffer, addr(s.data[s.pos]), result)
|
||||
inc(s.pos, result)
|
||||
else:
|
||||
result = 0
|
||||
|
||||
proc ssPeekData(s: Stream, buffer: pointer, bufLen: int): int =
|
||||
var s = StringStream(s)
|
||||
result = min(bufLen, s.data.len - s.pos)
|
||||
if result > 0:
|
||||
copyMem(buffer, addr(s.data[s.pos]), result)
|
||||
else:
|
||||
result = 0
|
||||
|
||||
proc ssWriteData(s: Stream, buffer: pointer, bufLen: int) =
|
||||
var s = StringStream(s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue