Created
July 24, 2010 21:51
-
-
Save goyox86/488997 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 308c6a2d41ab0a4dfa4fb9dc7ff07fa9df01e8a0 Mon Sep 17 00:00:00 2001 | |
From: Jose Narvaez <[email protected]> | |
Date: Sat, 24 Jul 2010 17:16:27 -0430 | |
Subject: [PATCH] Fix MatchData#string returns a frozen copy of the match string | |
--- | |
kernel/common/regexp.rb | 2 +- | |
1 files changed, 1 insertions(+), 1 deletions(-) | |
diff --git a/kernel/common/regexp.rb b/kernel/common/regexp.rb | |
index c734d7c..1b0737f 100644 | |
--- a/kernel/common/regexp.rb | |
+++ b/kernel/common/regexp.rb | |
@@ -568,7 +568,7 @@ end | |
class MatchData | |
def string | |
- @source | |
+ @source.dup.freeze | |
end | |
def source | |
-- | |
1.7.0.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment