mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
split --line-bytes=N (-C N): don't create an empty file.
* src/split.c (line_bytes_split): Don't create an empty line afterwards if the last buffer happens to be exactly full. * tests/misc/split-fail: Add a test case for this. * NEWS: mention this.
This commit is contained in:
1 parent
f839bfad73
commit
395fcee97a
4 files changed
+23
-2
No files matched your search
+5
-1
@@ -336,7 +336,11 @@ line_bytes_split (size_t n_bytes)
|
||||
|
||||
n_buffered += n_read;
|
||||
if (n_buffered != n_bytes)
|
||||
eof = true;
|
||||
{
|
||||
if (n_buffered == 0)
|
||||
break;
|
||||
eof = true;
|
||||
}
|
||||
|
||||
/* Find where to end this chunk. */
|
||||
bp = buf + n_buffered;
|
||||
|
||||
Reference in new issue
Block a user