Created
October 4, 2010 21:51
-
-
Save kronos/610511 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
diff --git a/kernel/common/string.rb b/kernel/common/string.rb | |
index 220bab2..4e175a7 100644 | |
--- a/kernel/common/string.rb | |
+++ b/kernel/common/string.rb | |
@@ -1063,9 +1063,9 @@ class String | |
return find_string(needle, offset) | |
when Regexp | |
- if match = needle.match_from(self[offset..-1], 0) | |
+ if match = needle.match_from(self, offset) | |
Regexp.last_match = match | |
- return (offset + match.begin(0)) | |
+ return match.begin(0) | |
else | |
Regexp.last_match = nil | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment