Skip to content

Commit

Permalink
Use chomp instead of chomp! in case the passed string is frozen
Browse files Browse the repository at this point in the history
Fixes #1077
  • Loading branch information
yokolet authored and jvshahid committed Feb 17, 2016
1 parent a9490c0 commit c66fb3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/java/nokogiri/XmlDocumentFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private static IRubyObject trim(ThreadContext context, XmlDocument xmlDocument,
// strips trailing \n off forcefully
// not to return new object in case of no chomp needed, chomp! is used here.
IRubyObject result;
if (context.getRuntime().is1_9()) result = str.chomp_bang19(context);
if (context.getRuntime().is1_9()) result = str.chomp19(context);
else result = str.chomp_bang(context);
return result.isNil() ? str : result;
}
Expand Down

0 comments on commit c66fb3c

Please sign in to comment.