Skip to content

Commit accd1f2

Browse files
committed
Rearrange order of date checks
works for all "older" Linux systems, MacOS, OpenBSD and according to #teki69 also Ubuntu 25.10 .
1 parent 36bc08c commit accd1f2

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

testssl.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -475,15 +475,15 @@ HAS_GNUDATE=false
475475
HAS_FREEBSDDATE=false
476476
HAS_OPENBSDDATE=false
477477
if date -d @735275209 >/dev/null 2>&1; then
478-
if date -r 735275209 >/dev/null 2>&1; then
479-
# It can't do any conversion from a plain date output.
480-
HAS_OPENBSDDATE=true
478+
if date -r @735275209 >/dev/null 2>&1; then
479+
# Ubuntu >= 25.10
480+
HAS_GNUDATE=true
481481
elif date -r 735275209 2>&1 | grep -q "No such file"; then
482482
# e.g. Debian 24.04, Debian 11-13
483483
HAS_GNUDATE=true
484-
elif date -r @735275209 >/dev/null 2>&1; then
485-
# Ubuntu >= 25.10
486-
HAS_GNUDATE=true
484+
elif date -r 735275209 >/dev/null 2>&1; then
485+
# It can't do any conversion from a plain date output.
486+
HAS_OPENBSDDATE=true
487487
fi
488488
fi
489489
# FreeBSD and OS X date(1) accept "-f inputformat", so do newer OpenBSD versions >~ 6.6.

0 commit comments

Comments
 (0)