>From 61036dc0d7565f24d5dbb7ded217dc411e7e3840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Thu, 20 Mar 2014 10:00:13 +0000 Subject: [PATCH] split: with --lines, process input immediately * src/split.c (lines_split): s/full_read/safe_read/. --- src/split.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/split.c b/src/split.c index 29d3dbf..7ff97e3 100644 --- a/src/split.c +++ b/src/split.c @@ -584,8 +584,8 @@ lines_split (uintmax_t n_lines, char *buf, size_t bufsize) do { - n_read = full_read (STDIN_FILENO, buf, bufsize); - if (n_read < bufsize && errno) + n_read = safe_read (STDIN_FILENO, buf, bufsize); + if (n_read == SAFE_READ_ERROR) error (EXIT_FAILURE, errno, "%s", infile); bp = bp_out = buf; eob = bp + n_read; @@ -614,7 +614,7 @@ lines_split (uintmax_t n_lines, char *buf, size_t bufsize) } } } - while (n_read == bufsize); + while (n_read); } /* Split into pieces that are as large as possible while still not more -- 1.7.7.6