summaryrefslogtreecommitdiff
blob: 330bbed9f66c2212f0941af3781a472276dd901d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- jcode.rb.orig	2003-12-11 06:13:41.000000000 +0900
+++ jcode.rb	2003-12-11 06:35:19.000000000 +0900
@@ -9,7 +9,7 @@
   printf STDERR, "feel free for some warnings:\n" if $VERBOSE
 
   def _regex_quote(str)
-    str.gsub(/(\\[][\-\\])|\\(.)|([][\\])/) do
+    str.gsub(/(\\[\[\]\-\\])|\\(.)|([\[\]\\])/) do
       $1 || $2 || '\\' + $3
     end
   end
@@ -19,9 +19,9 @@
   PATTERN_EUC = '[\xa1-\xfe][\xa1-\xfe]'
   PATTERN_UTF8 = '[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf][\x80-\xbf]'
 
-  RE_SJIS = Regexp.new(PATTERN_SJIS, 'n')
-  RE_EUC = Regexp.new(PATTERN_EUC, 'n')
-  RE_UTF8 = Regexp.new(PATTERN_UTF8, 'n')
+  RE_SJIS = Regexp.new(PATTERN_SJIS, 0, 'n')
+  RE_EUC = Regexp.new(PATTERN_EUC, 0, 'n')
+  RE_UTF8 = Regexp.new(PATTERN_UTF8, 0, 'n')
 
   SUCC = {}
   SUCC['s'] = Hash.new(1)
@@ -59,13 +59,13 @@
   def end_regexp
     case $KCODE[0]
     when ?s, ?S
-      /#{PATTERN_SJIS}$/o
+      /#{PATTERN_SJIS}$/on
     when ?e, ?E
-      /#{PATTERN_EUC}$/o
+      /#{PATTERN_EUC}$/on
     when ?u, ?U
-      /#{PATTERN_UTF8}$/o
+      /#{PATTERN_UTF8}$/on
     else
-      /.$/o
+      /.$/on
     end
   end