From 4c80efc655f9093a683957dcedfd37d42c9e2d80 Mon Sep 17 00:00:00 2001 From: Adam Hess Date: Tue, 20 Aug 2024 13:57:17 -0700 Subject: [PATCH] Mark mutable strings as mutable Running the test suite with RUBYOPT="--enable-frozen-string-literal" simulates Ruby's future behavior having frozen string on by default. This fixed the error that happens with this option enabled by marking two strings which are mutated as mutable with the + operator. --- lib/fast_gettext/vendor/mofile.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fast_gettext/vendor/mofile.rb b/lib/fast_gettext/vendor/mofile.rb index 0fa60cd..c7514b2 100644 --- a/lib/fast_gettext/vendor/mofile.rb +++ b/lib/fast_gettext/vendor/mofile.rb @@ -47,8 +47,8 @@ class HeaderRev1 < Header :trans_sysdep_tab_offset end - MAGIC_BIG_ENDIAN = "\x95\x04\x12\xde" - MAGIC_LITTLE_ENDIAN = "\xde\x12\x04\x95" + MAGIC_BIG_ENDIAN = +"\x95\x04\x12\xde" + MAGIC_LITTLE_ENDIAN = +"\xde\x12\x04\x95" if "".respond_to?(:force_encoding) MAGIC_BIG_ENDIAN.force_encoding("ASCII-8BIT") MAGIC_LITTLE_ENDIAN.force_encoding("ASCII-8BIT")