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:
Paul Eggert authored and Jim Meyering committed 2007-04-12 00:21:25 +02:00
1 parent f839bfad73
commit 395fcee97a
4 files changed
+23 -2

No files matched your search

+5 -1
View File
@@ -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;