projects
/
libs
/
core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
933356a
)
Some fixes for eof handling in Memory
author
Mikko Rasa
<tdb@tdb.fi>
Sun, 4 Nov 2012 20:35:27 +0000
(22:35 +0200)
committer
Mikko Rasa
<tdb@tdb.fi>
Sun, 4 Nov 2012 20:35:27 +0000
(22:35 +0200)
source/io/memory.cpp
patch
|
blob
|
history
diff --git
a/source/io/memory.cpp
b/source/io/memory.cpp
index bc14ff1fd4e832967b93f346a7fd4de29c74f552..f64b4be9e52edcb6fcae3bb94c99d69595fd4e80 100644
(file)
--- a/
source/io/memory.cpp
+++ b/
source/io/memory.cpp
@@
-66,6
+66,10
@@
unsigned Memory::do_read(char *buf, unsigned size)
unsigned Memory::put(char c)
{
check_access(M_WRITE);
+
+ if(pos==end)
+ return 0;
+
*pos++ = c;
return 1;
}
@@
-115,6
+119,7
@@
SeekOffset Memory::seek(SeekOffset off, SeekType type)
throw out_of_range("Memory::seek");
pos = new_pos;
+ eof_flag = false;
return pos-begin;
}