Created
July 18, 2010 15:36
-
-
Save reima/480485 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/vm/builtin/string.cpp b/vm/builtin/string.cpp | |
index d6db712..f5dd250 100644 | |
--- a/vm/builtin/string.cpp | |
+++ b/vm/builtin/string.cpp | |
@@ -434,7 +434,9 @@ namespace rubinius { | |
chr = str[i]; | |
seq = ++i < bytes ? str[i] : -1; | |
- if(seq == '-') { | |
+ if(chr == '\\' && seq >= 0) { | |
+ continue; | |
+ } else if(seq == '-') { | |
max = ++i < bytes ? str[i] : -1; | |
if(max >= 0) { | |
while(chr <= max) { | |
@@ -446,8 +448,6 @@ namespace rubinius { | |
if(tr_data.assign(chr)) return tr_replace(state, &tr_data); | |
if(tr_data.assign(seq)) return tr_replace(state, &tr_data); | |
} | |
- } else if(chr == '\\' && seq >= 0) { | |
- continue; | |
} else { | |
if(tr_data.assign(chr)) return tr_replace(state, &tr_data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment