From 0ce43d461eed3f963f51b9df905e37895a71ab7c Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 25 Jun 2009 04:10:21 +0000 Subject: * 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 --- tool/instruby.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tool') 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 -- cgit