Module Name: src
Committed By: christos
Date: Sun Jul 21 19:48:47 UTC 2024
Modified Files:
src/external/historical/nawk/dist: lib.c
Log Message:
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.14 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.14
--- src/external/historical/nawk/dist/lib.c:1.13 Mon Aug 31 19:37:55 2020
+++ src/external/historical/nawk/dist/lib.c Sun Jul 21 15:48:47 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;
}