Fix pre-epoch test workaround

It turns out that not all systems print an unsigned integer as the output of
`stat -c %Y xxx` and the leading `-` can be misinterpreted as a parameter to
`string match`.
This commit is contained in:
Mahmoud Al-Qudsi 2022-09-16 18:58:21 -05:00
parent 9cf56047fb
commit 613ecfc7e4

View File

@ -66,7 +66,7 @@ touch -m -t 190212112045.40 old
touch -m -t 190112112040.39 oldest
touch -m -t 203801080314.07 newest
if string match -qr '^(0|'(stat -c %Y epoch)')$' (stat -c %Y oldest)
if string match -qr '^(0|'(stat -c %Y epoch)')$' -- (stat -c %Y oldest)
# Filesystem does not support dates older than epoch, so silently skip this test - there's no
# guarantee that an FS supports pre-epoch timestamps and lxfs (virtual WSLv1 fs) doesn't.
else