Module Name: src
Committed By: martin
Date: Mon Nov 18 19:37:27 UTC 2024
Modified Files:
src/external/historical/nawk/dist [netbsd-10]: lib.c
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1012):
external/historical/nawk/dist/lib.c: revision 1.14
PR/58421: RVP: fix readdir on tmpfs. Upstream merge is complicated now because
the bsd branch has not been updated in ages.
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.6.1 src/external/historical/nawk/dist/lib.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/historical/nawk/dist/lib.c
diff -u src/external/historical/nawk/dist/lib.c:1.13 src/external/historical/nawk/dist/lib.c:1.13.6.1
--- src/external/historical/nawk/dist/lib.c:1.13 Mon Aug 31 23:37:55 2020
+++ src/external/historical/nawk/dist/lib.c Mon Nov 18 19:37:27 2024
@@ -240,6 +240,7 @@ int readrec(char **pbuf, int *pbufsize,
}
if (found)
setptr(patbeg, '\0');
+ isrec = found != 0 || *buf != '\0';
} else {
if ((sep = *rs) == 0) {
sep = '\n';
@@ -269,10 +270,10 @@ int readrec(char **pbuf, int *pbufsize,
if (!adjbuf(&buf, &bufsize, 1+rr-buf, recsize, &rr, "readrec 3"))
FATAL("input record `%.30s...' too long", buf);
*rr = 0;
+ isrec = c != EOF || rr != buf;
}
*pbuf = buf;
*pbufsize = bufsize;
- isrec = *buf || !feof(inf);
dprintf( ("readrec saw <%s>, returns %d\n", buf, isrec) );
return isrec;
}