Paul Eggert <[EMAIL PROTECTED]> wrote: > Jim Meyering <[EMAIL PROTECTED]> writes: > >> + If the number of bytes left to skip is larger than >> + the size of the current file, we can decrement >> + n_skip and go on to the next file. */ >> if (S_ISREG (file_stats.st_mode) && 0 <= file_stats.st_size) > > An idle thought. Given the problems we've had elsewhere with /proc > files that claim to be regular files of size zero, perhaps the above > line should be changed to the following? > > if (S_ISREG (file_stats.st_mode) && 0 < file_stats.st_size) > > More generally, the idea is that if a file claims to be a regular file > of size zero, then GNU utilities should not attempt to do > optimizations based on the assumption that the file is empty, but > should go ahead and try to actually read the file. It's kind of a > pain to treat size-zero files specially, but there it is.
Good catch. Yes, it is good to work around kernel lies, at least when it's recent Linux :-) I'll check that in this evening, along with a test. _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils