Don't open files that will be skipped
authorjeremy <jeremy@openbsd.org>
Mon, 10 Jul 2023 16:28:33 +0000 (16:28 +0000)
committerjeremy <jeremy@openbsd.org>
Mon, 10 Jul 2023 16:28:33 +0000 (16:28 +0000)
commit07ca5729a7c0ba1dc710c90e6ebcd6147a45b827
tree98b14b5558da21c7fd9c4e923c370b817311d9a8
parent80663c2667c9960b3abac430b24d70b0bfafc17c
Don't open files that will be skipped

Previously, when creating an archive file with pax(1), pax will attempt
to open a file even if the file will be skipped due to an -s replacement
with the empty string. With this change, pax will not attempt to open
files that it knows will be skipped.

When doing direct copies to a directory (-rw), pax already skips
the file before attempting to open it. So this makes the behavior
more consistent.

This can measurably speed up pax when skipping a large number of files.

OK tb@
bin/pax/ar_subs.c