From 3f7aa81d9212811b323d89949adcccda212cbed3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 4 Nov 2012 22:35:27 +0200 Subject: [PATCH] Some fixes for eof handling in Memory --- source/io/memory.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/io/memory.cpp b/source/io/memory.cpp index bc14ff1..f64b4be 100644 --- 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; } -- 2.43.0