nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb53c14
)
lib/core: fix read_bytes_to_cstring implementation
author
Lucas Bajolet
<lucas.bajolet@gmail.com>
Thu, 10 May 2018 21:49:47 +0000
(17:49 -0400)
committer
Lucas Bajolet
<lucas.bajolet@gmail.com>
Fri, 11 May 2018 18:37:20 +0000
(14:37 -0400)
When reading bytes from both the lookahead and a source, the lookahead
bytes were not kept in the cstring and we re-written by the
raw_read_bytes after that.
This commit fixes that behaviour.
Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>
lib/core/stream.nit
patch
|
blob
|
history
diff --git
a/lib/core/stream.nit
b/lib/core/stream.nit
index
5447b94
..
c86ea1b
100644
(file)
--- a/
lib/core/stream.nit
+++ b/
lib/core/stream.nit
@@
-240,7
+240,7
@@
abstract class Reader
else
lookahead_length = 0
end
- return rd + raw_read_bytes(bytes, max - rd)
+ return rd + raw_read_bytes(bytes.fast_cstring(rd), max - rd)
end
# Read a string until the end of the line.