projects
/
projects
/
chimara
/
chimara.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Keep an EOF mark for memory streams
[projects/chimara/chimara.git]
/
libchimara
/
strio.c
diff --git
a/libchimara/strio.c
b/libchimara/strio.c
index 039e189a5d8676b6c34506ebeb63a02add52ab9e..b0d0fd16582dbc8f480391cf8288e081605ec01f 100644
(file)
--- a/
libchimara/strio.c
+++ b/
libchimara/strio.c
@@
-310,6
+310,10
@@
write_buffer_to_stream(strid_t str, gchar *buf, glui32 len)
str->mark += copycount;
}
str->mark += copycount;
}
+ /* Move the EOF marker if we wrote past it */
+ if(str->mark > str->endmark)
+ str->endmark = str->mark;
+
str->write_count += len;
break;
str->write_count += len;
break;
@@
-402,6
+406,10
@@
write_buffer_to_stream_uni(strid_t str, glui32 *buf, glui32 len)
str->mark += copycount;
}
str->mark += copycount;
}
+ /* Move the EOF marker if we wrote past it */
+ if(str->mark > str->endmark)
+ str->endmark = str->mark;
+
str->write_count += len;
break;
str->write_count += len;
break;
@@
-1343,7
+1351,7
@@
glk_stream_set_position(strid_t str, glsi32 pos, glui32 seekmode)
{
case seekmode_Start: str->mark = pos; break;
case seekmode_Current: str->mark += pos; break;
{
case seekmode_Start: str->mark = pos; break;
case seekmode_Current: str->mark += pos; break;
- case seekmode_End: str->mark = str->
buflen
+ pos; break;
+ case seekmode_End: str->mark = str->
endmark
+ pos; break;
default:
g_return_if_reached();
return;
default:
g_return_if_reached();
return;