diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2023-03-04 11:41:02 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2023-03-04 14:49:45 -0800 |
commit | 0d997e18b99e87fa2f2ca96f3611ada87758c020 (patch) | |
tree | f60640e313f411f58566bcf364f8d709fa93cddf | |
parent | f749449e5c8d687468476f39c4a05cb77f0dd433 (diff) | |
download | coreutils-0d997e18b99e87fa2f2ca96f3611ada87758c020.tar.gz |
split: small -n lines simplification
* src/split.c (lines_chunk_split):
Rewrite while as if-while for clarity.
-rw-r--r-- | src/split.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/split.c b/src/split.c index d3d1dde8c..574250d27 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. */ |