diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-21 15:13:23 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-21 15:13:23 +0000 |
commit | 58ef7c20880642c88d06b351f8bbaaa291898e58 (patch) | |
tree | 0ed5f63dd297a8bcc2dc5fa5e35b3e84a19a6ca2 /ext | |
parent | 108cf940d8d617dcabb5e5b17e6315b023ecc301 (diff) | |
download | ruby-58ef7c20880642c88d06b351f8bbaaa291898e58.tar.gz |
* regex.c (re_compile_pattern): fix previous change.
* instruby.rb, ext/extmk.rb, ext/tk/lib/tk.rb, lib/benchmark.rb,
lib/cgi.rb, lib/debug.rb, lib/getoptlong.rb, lib/jcode.rb,
lib/optparse.rb, lib/time.rb, lib/date/format.rb,
lib/irb/ruby-lex.rb: escape `[', `]', `-' in chracter class in
regexp to avoid warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/extmk.rb | 2 | ||||
-rw-r--r-- | ext/tk/lib/tk.rb | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb index 06a9fd50fc..326310c47f 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -127,7 +127,7 @@ def parse_args() $mflags = Shellwords.shellwords(mflags) if arg = $mflags.first - arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg + arg.insert(0, '-') if /\A[^\-][^=]*\Z/ =~ arg end $make, *rest = Shellwords.shellwords($make) diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 9a15f09989..c24d6150aa 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -605,7 +605,7 @@ module TkCore end def rb_appsend(interp, async, *args) - args = args.collect!{|c| _get_eval_string(c).gsub(/[][$"]/, '\\\\\&')} + args = args.collect!{|c| _get_eval_string(c).gsub(/[\]\[$"]/, '\\\\\&')} args.push(').to_s"') appsend(interp, async, 'ruby "(', *args) end @@ -620,7 +620,7 @@ module TkCore end def rb_appsend_displayof(interp, win, async, *args) - args = args.collect!{|c| _get_eval_string(c).gsub(/[][$"]/, '\\\\\&')} + args = args.collect!{|c| _get_eval_string(c).gsub(/[\]\[$"]/, '\\\\\&')} args.push(').to_s"') appsend_displayof(interp, win, async, 'ruby "(', *args) end @@ -1179,14 +1179,14 @@ class TkVariable elsif val.kind_of?(Array) a = [] val.each_with_index{|e,i| a.push(i); a.push(array2tk_list(e))} - s = '"' + a.join(" ").gsub(/[][$"]/, '\\\\\&') + '"' + s = '"' + a.join(" ").gsub(/[\]\[$"]/, '\\\\\&') + '"' INTERP._eval(format('global %s; array set %s %s', @id, @id, s)) elsif val.kind_of?(Hash) s = '"' + val.to_a.collect{|e| array2tk_list(e)}.join(" ")\ - .gsub(/[][$"]/, '\\\\\&') + '"' + .gsub(/[\]\[$"]/, '\\\\\&') + '"' INTERP._eval(format('global %s; array set %s %s', @id, @id, s)) else - s = '"' + _get_eval_string(val).gsub(/[][$"]/, '\\\\\&') + '"' + s = '"' + _get_eval_string(val).gsub(/[\]\[$"]/, '\\\\\&') + '"' INTERP._eval(format('global %s; set %s %s', @id, @id, s)) end end @@ -1214,7 +1214,7 @@ class TkVariable def value=(val) begin - s = '"' + _get_eval_string(val).gsub(/[][$"]/, '\\\\\&') + '"' + s = '"' + _get_eval_string(val).gsub(/[\]\[$"]/, '\\\\\&') + '"' INTERP._eval(format('global %s; set %s %s', @id, @id, s)) rescue if INTERP._eval(format('global %s; array exists %s', @id, @id)) != "1" @@ -1226,12 +1226,12 @@ class TkVariable elsif val.kind_of?(Array) a = [] val.each_with_index{|e,i| a.push(i); a.push(array2tk_list(e))} - s = '"' + a.join(" ").gsub(/[][$"]/, '\\\\\&') + '"' + s = '"' + a.join(" ").gsub(/[\]\[$"]/, '\\\\\&') + '"' INTERP._eval(format('global %s; unset %s; array set %s %s', @id, @id, @id, s)) elsif val.kind_of?(Hash) s = '"' + val.to_a.collect{|e| array2tk_list(e)}.join(" ")\ - .gsub(/[][$"]/, '\\\\\&') + '"' + .gsub(/[\]\[$"]/, '\\\\\&') + '"' INTERP._eval(format('global %s; unset %s; array set %s %s', @id, @id, @id, s)) else @@ -1438,7 +1438,7 @@ class TkVarAccess<TkVariable def initialize(varname, val=nil) @id = varname if val - s = '"' + _get_eval_string(val).gsub(/[][$"]/, '\\\\\&') + '"' #" + s = '"' + _get_eval_string(val).gsub(/[\]\[$"]/, '\\\\\&') + '"' #" INTERP._eval(format('global %s; set %s %s', @id, @id, s)) end end |