summaryrefslogtreecommitdiff
path: root/lib/jcode.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jcode.rb')
-rw-r--r--lib/jcode.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/jcode.rb b/lib/jcode.rb
index 77aedaa3bc..0f53b7185b 100644
--- a/lib/jcode.rb
+++ b/lib/jcode.rb
@@ -5,7 +5,9 @@ class String
printf STDERR, "feel free for some warnings:\n" if $VERBOSE
def _regex_quote(str)
- a = str.gsub(/\W/){|s| if s == "-" then s else "\\\\#{s}" end}
+ str.gsub(/\W/){|s|
+ if s == "-" then s elsif s == "\\" then "\\\\" else "\\\\#{s}" end
+ }
end
private :_regex_quote