Skip to content

Commit bea1016

Browse files
committed
bash: avoid using strchrnul on macOS 15 and older
This should avoid crashes on macOS 15.0-15.4.
1 parent e854ce5 commit bea1016

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Formula/b/bash.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ def install
114114

115115
ENV.append_to_cflags "-DDEFAULT_LOADABLE_BUILTINS_PATH='\"#{bash_loadables_path}\"'"
116116

117+
# Avoid crashes on macOS 15.0-15.4.
118+
ENV["bash_cv_func_strchrnul_works"] = "no" if OS.mac? && MacOS.version <= :sequoia
119+
117120
system "./configure", "--prefix=#{prefix}", "--with-curses", "--with-installed-readline"
118121
system "make", "install"
119122

@@ -130,5 +133,9 @@ def caveats
130133
# If the following assertion breaks, then it's likely the configuration of `DEFAULT_LOADABLE_BUILTINS_PATH`
131134
# is broken. Changing the test below will probably hide that breakage.
132135
assert_equal "csv is a shell builtin\n", shell_output("#{bin}/bash -c 'enable csv; type csv'")
136+
137+
return if OS.linux? || MacOS.version > :sequoia
138+
139+
refute_match "U _strchrnul", shell_output("nm #{bin}/bash")
133140
end
134141
end

0 commit comments

Comments
 (0)