summaryrefslogtreecommitdiff
path: root/tool/mkconfig.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-30 07:55:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-30 07:55:36 +0000
commit9ae3b070c12851600273463fff14bb79b101440d (patch)
tree949db184b25902d574bb3c8613031bc95831d663 /tool/mkconfig.rb
parent99c8ded878ba60391fb5439a2b17adefa607a3dd (diff)
* tool/mkconfig.rb (RbConfig.expand): get rid of exceptions on
frozen strings unless really changed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/mkconfig.rb')
-rwxr-xr-xtool/mkconfig.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index 116791d..a66a20f 100755
--- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb
@@ -181,21 +181,21 @@ print <<EOS
MAKEFILE_CONFIG = {}
CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
def RbConfig::expand(val, config = CONFIG)
- val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do
+ newval = val.gsub(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) {
var = $&
if !(v = $1 || $2)
'$'
elsif key = config[v = v[/\\A[^:]+(?=(?::(.*?)=(.*))?\\z)/]]
pat, sub = $1, $2
config[v] = false
- RbConfig::expand(key, config)
- config[v] = key
+ config[v] = RbConfig::expand(key, config)
key = key.gsub(/\#{Regexp.quote(pat)}(?=\\s|\\z)/n) {sub} if pat
key
else
var
end
- end
+ }
+ val.replace(newval) unless newval == val
val
end
CONFIG.each_value do |val|