Paul Eggert
62e7af0326
split: fix problems with /dev/zero
...
Problem reported by Nelson H.F. Beebe in: http://bugs.gnu.org/22624
Other problems also fixed: basically, the code got confused because
GNU/Linux reports that /dev/zero has size zero.
* src/split.c (input_file_size): Now takes struct stat *, not just
size. Always store the first buffer. All callers changed. Treat
/dev/zero as an infinitely-large file, both on GNU/Linux where
fstat and lseek say its size is zero, and on GNU/Hurd where they
say the size is OFF_T_MAX.
(cwrite): Return true on success.
(bytes_split): Don't try to read past EOF, and stop if a write fails.
(lines_rr): Omit stray check for ignorable errno.
(main): Get file size only when n_units > 1, since that's the only
time it is needed. Defer most of the work to input_file_size.
* tests/split/l-chunk.sh: Adjust tests to match new behavior
on oddball inputs.
2016-02-12 10:16:47 -08:00
..
2015-09-03 00:33:19 +01:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-13 10:59:56 +00:00
2016-01-16 11:40:54 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2008-11-20 10:21:52 +01:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-13 10:59:56 +00:00
2016-01-29 23:12:08 -08:00
2016-01-01 14:10:41 +00:00
2016-01-13 11:16:39 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2005-07-18 07:52:37 +00:00
2015-01-31 17:39:04 +01:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-13 10:59:55 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-03 12:58:39 +00:00
2016-01-01 14:10:41 +00:00
2016-01-13 10:59:18 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2012-01-09 21:51:59 +01:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-13 11:11:36 +00:00
2016-01-01 14:10:41 +00:00
2016-01-15 14:14:06 +00:00
2016-01-01 14:10:41 +00:00
2016-01-13 10:59:56 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-14 01:26:00 +00:00
2016-02-12 10:16:47 -08:00
2016-01-13 11:16:39 +00:00
2016-01-01 14:10:41 +00:00
2016-01-06 16:04:19 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-24 18:09:08 -08:00
2016-01-01 14:10:41 +00:00
2016-01-13 10:59:56 +00:00
2016-01-19 14:07:10 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2007-07-10 19:00:00 +02:00
2007-07-10 19:00:00 +02:00
2016-01-01 14:10:41 +00:00
2012-01-09 21:51:59 +01:00
2016-01-01 14:10:41 +00:00
2016-01-13 10:59:18 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-13 11:11:36 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00
2016-01-01 14:10:41 +00:00