summaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-25 04:10:21 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-25 04:10:21 +0000
commit0ce43d461eed3f963f51b9df905e37895a71ab7c (patch)
tree2b569b597c0d1fa8707fdf27e13c4b0175111cf9 /tool
parentc28e627757d467d0499972be97ef8f7b75c42a4a (diff)
downloadruby-0ce43d461eed3f963f51b9df905e37895a71ab7c.tar.gz
ruby-0ce43d461eed3f963f51b9df905e37895a71ab7c.tar.xz
ruby-0ce43d461eed3f963f51b9df905e37895a71ab7c.zip
* instruby.rb: '&' in sed s command's replacement is '\&' in ruby.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-xtool/instruby.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/tool/instruby.rb b/tool/instruby.rb
index 3c277720d..730a9151d 100755
--- a/tool/instruby.rb
+++ b/tool/instruby.rb
@@ -391,7 +391,7 @@ install?(:local, :comm, :bin, :'bin-comm') do
when 's'
next if pat == '^' and rep.empty?
exp << [addr, (opt.include?('g') ? :gsub! : :sub!),
- Regexp.new(pat, opt.include?('i')), rep]
+ Regexp.new(pat, opt.include?('i')), rep.gsub(/&/){'\&'}]
when 'y'
exp << [addr, :tr!, Regexp.quote(pat), rep]
end