On 01/11/2025 04:40, Collin Funk wrote:
[1] https://lists.gnu.org/archive/html/bug-gnulib/2025-10/msg00171.html
[2] 
https://github.com/coreutils/gnulib/commit/94e01571507835ff59dd8ce2a0b56a4b566965a4
-- 8< --

* tests/date/date-tz.sh: Allow date to fail with large values for TZ
since NetBSD's tzalloc function limits them to 256 bytes.
---
  tests/date/date-tz.sh | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/date/date-tz.sh b/tests/date/date-tz.sh
index 5390cf568..05736f90d 100755
--- a/tests/date/date-tz.sh
+++ b/tests/date/date-tz.sh
@@ -21,6 +21,12 @@ print_ver_ date
# coreutils-8.27 would overwrite the heap with large TZ values
  tz_long=$(printf '%2000s' | tr ' ' a)
-date -d "TZ=\"${tz_long}0\" 2017" || fail=1
+date -d "TZ=\"${tz_long}0\" 2017" 2> err
+
+# Gnulib's tzalloc handles arbitrarily long TZ values, but NetBSD's does not.
+case $? in
+  0) ;;
+  *) grep '^date: invalid date' err || fail=1 ;;
+esac
Exit $fail

Looks good.

cheers,

Padraig

Reply via email to