From 6963ee6a52cae7a6630d1d12cb8b0caad0f6c49f Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Sun, 19 Sep 2021 22:44:25 -0700
Subject: [PATCH] tests: env-s.pl: avoid spurious failure on OS X

* tests/misc/env-S.pl: The __CF_USER_TEXT_ENCODING envvar
would cause many of these sub-tests to fail. Ignore it.
---
 tests/misc/env-S.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/misc/env-S.pl b/tests/misc/env-S.pl
index 73dcb5cfe..81d70c9fe 100755
--- a/tests/misc/env-S.pl
+++ b/tests/misc/env-S.pl
@@ -30,6 +30,12 @@ $env = $1;
 # Turn off localization of executable's output.
 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;

+# This envvar is somehow set at least on macOS 11.6, and would
+# otherwise cause failure of q*, t* and more tests below.  Ignore it.
+my $cf = '__CF_USER_TEXT_ENCODING';
+exists $ENV{$cf}
+  and $env .= " -u$cf";
+
 my @Tests =
     (
      # Test combination of -S and regular arguments
-- 
2.33.0.142.ge0a2f5cbc5

