Skip to content

Commit

Permalink
Mark mutable strings as mutable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
HParker committed Aug 20, 2024
1 parent c745ce8 commit 4c80efc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/fast_gettext/vendor/mofile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 4c80efc

Please sign in to comment.