From: Paul Eggert Date: Sat, 4 Mar 2023 19:41:02 +0000 (-0800) Subject: split: small -n lines simplification X-Git-Tag: v9.2~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d997e18b99e87fa2f2ca96f3611ada87758c020;p=thirdparty%2Fcoreutils.git split: small -n lines simplification * src/split.c (lines_chunk_split): Rewrite while as if-while for clarity. --- diff --git a/src/split.c b/src/split.c index d3d1dde8c2..574250d272 100644 --- a/src/split.c +++ b/src/split.c @@ -980,8 +980,9 @@ lines_chunk_split (uintmax_t k, uintmax_t n, char *buf, size_t bufsize, /* Ensure NUMBER files are created, which truncates any existing files or notifies any consumers on fifos. FIXME: Should we do this before EXIT_FAILURE? */ - while (!k && chunk_no++ <= n) - cwrite (true, NULL, 0); + if (!k) + while (chunk_no++ <= n) + cwrite (true, NULL, 0); } /* -n K/N: Extract Kth of N chunks. */