Fix a bug that caused nothing to be skipped when skipping exactly the

number of bytes present in a regular file was requested.

Obtained from:	OpenBSD
This commit is contained in:
Kevin Lo 2016-02-14 14:23:56 +00:00
parent bcccdfa37b
commit daa1a379ce
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=295610

View file

@ -374,7 +374,7 @@ doskip(const char *fname, int statok)
if (statok) {
if (fstat(fileno(stdin), &sb))
err(1, "%s", fname);
if (S_ISREG(sb.st_mode) && skip >= sb.st_size) {
if (S_ISREG(sb.st_mode) && skip > sb.st_size) {
address += sb.st_size;
skip -= sb.st_size;
return;