From 8efcc02512b6ae020b366620032686a80b570587 Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Tue, 14 Aug 2007 15:59:48 +0000 Subject: 20070814-1659 --- CHANGES | 2 ++ appl/lib/bufio.b | 11 ++++++----- dis/lib/bufio.dis | Bin 4608 -> 4630 bytes include/version.h | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index afe33af0..82e8bddc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +20070814 + bufio.b didn't update the buffer pointers correctly on write errors 20070807 libinterp/keyring.c don't include owner= if owner is nil or "" add auth/rsagen diff --git a/appl/lib/bufio.b b/appl/lib/bufio.b index 5960e310..ab884649 100644 --- a/appl/lib/bufio.b +++ b/appl/lib/bufio.b @@ -88,17 +88,16 @@ readchunk(b: ref Iobuf): int writechunk(b: ref Iobuf): int { - if (b.fd == nil) - return ERROR; + err := (b.fd == nil); if (b.filpos != b.bufpos) { if (sys->seek(b.fd, b.bufpos, 0) != b.bufpos) - return ERROR; + err = 1; b.filpos = b.bufpos; } if ((size := b.size) > Bufsize) size = Bufsize; if (sys->write(b.fd, b.buffer, size) != size) - return ERROR; + err = 1; b.filpos += big size; b.size -= size; if (b.size) { @@ -108,6 +107,8 @@ writechunk(b: ref Iobuf): int b.dirty = 0; b.bufpos += big size; b.index -= size; + if(err) + return ERROR; return size; } @@ -295,7 +296,7 @@ Iobuf.ungetc(b: self ref Iobuf): int stop = 0; buf := b.buffer[0:b.size]; for(i := b.index-1; i >= stop; i--){ - (r, n, s) := sys->byte2char(buf, i); + (nil, n, s) := sys->byte2char(buf, i); if(s && i + n == b.index){ b.index = i; return 1; diff --git a/dis/lib/bufio.dis b/dis/lib/bufio.dis index 62c1103b..17f118f4 100644 Binary files a/dis/lib/bufio.dis and b/dis/lib/bufio.dis differ diff --git a/include/version.h b/include/version.h index fc249843..e3870e6c 100644 --- a/include/version.h +++ b/include/version.h @@ -1 +1 @@ -#define VERSION "Fourth Edition (20070807)" +#define VERSION "Fourth Edition (20070814)" -- cgit v1.2.3