--- sort.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sort.c b/sort.c index 5cfe801..90ee911 100644 --- a/sort.c +++ b/sort.c _AT_@ -210,10 +210,15 @@ check(FILE *fp, const char *fname) { static struct line prev, cur, tmp; static size_t prevsize, cursize, tmpsize; + ssize_t len; - if (!prev.data && (prev.len = getline(&prev.data, &prevsize, fp)) < 0) - eprintf("getline:"); - while ((cur.len = getline(&cur.data, &cursize, fp)) > 0) { + if (!prev.data) { + if ((len = getline(&prev.data, &prevsize, fp)) < 0) + eprintf("getline:"); + prev.len = len; + } + while ((len = getline(&cur.data, &cursize, fp)) > 0) { + cur.len = len; if (uflag > slinecmp(&cur, &prev)) { if (!Cflag) { weprintf("disorder %s: ", fname); -- 1.8.5.1Received on Sat Mar 12 2016 - 20:46:31 CET
This archive was generated by hypermail 2.3.0 : Sun Mar 13 2016 - 04:00:23 CET