aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-05-09 12:00:20 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-05-09 12:00:20 +0300
commit57dfae2cdd29002643719cfb42b42aeb50e57bfe (patch)
tree2a9c29685a04d840117594852a901cb13e61de48 /io.c
parent7dfa21486fdb9f30f8adcb7b7207458000b02866 (diff)
parent40694fc1c11bae6fac8e809a6a4c161c12cc37b7 (diff)
downloadegawk-57dfae2cdd29002643719cfb42b42aeb50e57bfe.tar.gz
egawk-57dfae2cdd29002643719cfb42b42aeb50e57bfe.tar.bz2
egawk-57dfae2cdd29002643719cfb42b42aeb50e57bfe.zip
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/io.c b/io.c
index 2bb8f28a..b1c9fa18 100644
--- a/io.c
+++ b/io.c
@@ -206,6 +206,7 @@ typedef enum { CLOSE_ALL, CLOSE_TO, CLOSE_FROM } two_way_close_type;
#define at_eof(iop) (((iop)->flag & IOP_AT_EOF) != 0)
#define has_no_data(iop) ((iop)->dataend == NULL)
#define no_data_left(iop) ((iop)->off >= (iop)->dataend)
+#define buffer_has_all_data(iop) ((iop)->dataend - (iop)->off == (iop)->public.sbuf.st_size)
/*
* The key point to the design is to split out the code that searches through
@@ -3474,6 +3475,8 @@ get_a_record(char **out, /* pointer to pointer to data */
iop->flag &= ~IOP_AT_START;
if (ret == REC_OK)
break;
+ if (ret == TERMNEAREND && buffer_has_all_data(iop))
+ break;
/* need to add more data to buffer */
/* shift data down in buffer */