nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
93c872a
)
lib/stream: BufferedReader return the buffer if less than asked to read
author
Jean Privat
<jean@pryen.org>
Fri, 6 Mar 2015 13:09:05 +0000
(20:09 +0700)
committer
Jean Privat
<jean@pryen.org>
Tue, 10 Mar 2015 13:43:26 +0000
(20:43 +0700)
Signed-off-by: Jean Privat <jean@pryen.org>
lib/standard/stream.nit
patch
|
blob
|
history
diff --git
a/lib/standard/stream.nit
b/lib/standard/stream.nit
index
476c684
..
6079d95
100644
(file)
--- a/
lib/standard/stream.nit
+++ b/
lib/standard/stream.nit
@@
-344,6
+344,7
@@
abstract class BufferedReader
if _buffer_pos + i >= _buffer.length then
var from = _buffer_pos
_buffer_pos = _buffer.length
+ if from == 0 then return _buffer.to_s
return _buffer.substring_from(from).to_s
end
_buffer_pos += i