-/* $OpenBSD: lib.c,v 1.45 2021/04/19 14:08:55 millert Exp $ */
+/* $OpenBSD: lib.c,v 1.46 2021/06/10 21:01:43 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
}
if (found)
setptr(patbeg, '\0');
+ isrec = (found == 0 && *buf == '\0') ? 0 : 1;
} else {
if ((sep = *rs) == 0) {
sep = '\n';
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) ? 0 : 1;
}
*pbuf = buf;
*pbufsize = bufsize;
- isrec = *buf || !feof(inf);
DPRINTF("readrec saw <%s>, returns %d\n", buf, isrec);
return isrec;
}