From 798a35a7b3d77aa83b093e87773f8ca85c1af2e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Sat, 26 Jul 2025 20:06:42 +0100 Subject: [PATCH] maint: avoid :> pattern in tests This was seen to trigger the EXIT trap on cygwin * cfg.mk (sc_prohibit_colon_redirection): Disallow all cases of :> in tests/ * tests/cksum/md5sum-bsd.sh: Adjust to avoid more stringent syntax check. --- cfg.mk | 5 +++-- tests/cksum/md5sum-bsd.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cfg.mk b/cfg.mk index 96aac60378..56c70f244d 100644 --- a/cfg.mk +++ b/cfg.mk @@ -144,9 +144,10 @@ sc_ensure_gl_diffs_apply_cleanly: done # Avoid :>file which doesn't propagate errors +# Also :>file was seen to trigger EXIT trap on cygwin sc_prohibit_colon_redirection: - @cd $(srcdir)/tests && GIT_PAGER= git grep -En ': *>.*\|\|' \ - && { echo '$(ME): '"The leading colon in :> will hide errors" >&2; \ + @cd $(srcdir)/tests && GIT_PAGER= git grep -En ': *>[^>]' \ + && { echo '$(ME): '":> will hide errors or may trigger EXIT" >&2; \ exit 1; } \ || : diff --git a/tests/cksum/md5sum-bsd.sh b/tests/cksum/md5sum-bsd.sh index 1f80ccbe1c..4986f01444 100755 --- a/tests/cksum/md5sum-bsd.sh +++ b/tests/cksum/md5sum-bsd.sh @@ -78,7 +78,7 @@ if echo '' > 'backslash\is\not\dir\sep'; then t=' ' rm check.md5 for i in 'a\b' 'a\' '\a' "a${nl}b" "a${t}b"; do - : > "$i" + rm -f "$i" && touch "$i" md5sum --tag "$i" >> check.md5 || fail=1 done md5sum --strict -c check.md5 > out || fail=1 -- 2.47.2