diff options
author | Tor Andersson <tor@ghostscript.com> | 2011-03-06 13:30:01 +0000 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2011-03-06 13:30:01 +0000 |
commit | 2d919ffba311dde73dc957f325ee55c7ce4f66fa (patch) | |
tree | 4bc02aa664c92a1002cec047a7ccece22eee77e2 /fitz/stm_open.c | |
parent | 9dee36047ab01f929582fa7b715af392f2de7d24 (diff) | |
download | mupdf-2d919ffba311dde73dc957f325ee55c7ce4f66fa.tar.xz |
Add explicit EOF testing functions.
Diffstat (limited to 'fitz/stm_open.c')
-rw-r--r-- | fitz/stm_open.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fitz/stm_open.c b/fitz/stm_open.c index b81d9176..6f1160d8 100644 --- a/fitz/stm_open.c +++ b/fitz/stm_open.c @@ -10,7 +10,8 @@ fz_newstream(void *state, stm = fz_malloc(sizeof(fz_stream)); stm->refs = 1; - stm->dead = 0; + stm->error = 0; + stm->eof = 0; stm->pos = 0; stm->bits = 0; @@ -105,8 +106,9 @@ static void seekbuffer(fz_stream *stm, int offset, int whence) if (whence == 1) stm->rp += offset; if (whence == 2) - stm->rp = stm->wp - offset; - stm->rp = CLAMP(stm->rp, stm->bp, stm->wp); + stm->rp = stm->ep - offset; + stm->rp = CLAMP(stm->rp, stm->bp, stm->ep); + stm->wp = stm->ep; } static void closebuffer(fz_stream *stm) |