aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2012-07-26 11:56:00 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2012-07-26 11:56:00 -0400
commitca83de0ec92b56c712f7a7376b21a1a1337b3107 (patch)
tree1047916b5164a57d12ff50eaf26e5954803f0e29 /io.c
parent1a69f3ec43ba9748ad63443f88b2e26b014c11d2 (diff)
downloadegawk-ca83de0ec92b56c712f7a7376b21a1a1337b3107.tar.gz
egawk-ca83de0ec92b56c712f7a7376b21a1a1337b3107.tar.bz2
egawk-ca83de0ec92b56c712f7a7376b21a1a1337b3107.zip
Document the parser interface and remove some excessive readdir paranoia.
Diffstat (limited to 'io.c')
-rw-r--r--io.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/io.c b/io.c
index 6cfc3efe..05e87907 100644
--- a/io.c
+++ b/io.c
@@ -3036,7 +3036,7 @@ find_longest_terminator:
return REC_OK;
}
-/* get_a_record --- read a record from IOP into out, return length of EOF, set RT */
+/* get_a_record --- read a record from IOP into out, return length of EOF, set RT. Note that errcode is never NULL, and the caller initializes *errcode to 0. */
static int
get_a_record(char **out, /* pointer to pointer to data */
@@ -3071,8 +3071,7 @@ get_a_record(char **out, /* pointer to pointer to data */
return EOF;
} else if (iop->count == -1) {
iop->flag |= IOP_AT_EOF;
- if (errcode != NULL)
- *errcode = errno;
+ *errcode = errno;
return EOF;
} else {
iop->dataend = iop->buf + iop->count;