'fold' will no longer truncate output when encountering 0xFF bytes.
[bug introduced in coreutils-9.8]
+ 'fold' is again responsive to its input. Previously it would have delayed
+ processing until 256KiB was read from the input.
+ [bug introduced in coreutils-9.8]
+
'kill --help' now has links to valid anchors in the html manual.
[bug introduced in coreutils-9.10]
At end of file, MBBUF.EOF is set, and zero will eventually be returned.
Note feof() will _NOT_ be set on the MBBUF.FP. */
MBBUF_INLINE idx_t
-mbbuf_fill (mbbuf_t *mbbuf)
+mbbuf_topup (mbbuf_t *mbbuf)
{
idx_t available = mbbuf_avail (mbbuf);
return available;
}
+/* Fill the input buffer enough to scan the next character if possible.
+ Return the number of bytes available from the current offset. */
+MBBUF_INLINE idx_t
+mbbuf_fill (mbbuf_t *mbbuf)
+{
+ idx_t available = mbbuf_avail (mbbuf);
+
+ if (available == 0)
+ return mbbuf_topup (mbbuf);
+
+ if (available < MCEL_LEN_MAX && ! mbbuf->eof)
+ {
+ mcel_t g = mcel_scan (mbbuf->buffer + mbbuf->offset,
+ mbbuf->buffer + mbbuf->length);
+ if (g.err)
+ return mbbuf_topup (mbbuf);
+ }
+
+ return available;
+}
+
/* Consume N bytes from the current buffer. */
MBBUF_INLINE void
mbbuf_advance (mbbuf_t *mbbuf, idx_t n)
while (true)
{
- idx_t n_avail = mbbuf_fill (&mbbuf);
+ idx_t n_avail = mbbuf_topup (&mbbuf);
search.at_eof = mbbuf.eof;
search.line_end_known = false;