summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 1eb52047a38..d801a6ad8b8 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -2050,8 +2050,11 @@ RULES
suffixes << m[1] << m[2]
implicit = [[m[1], m[2]], [m.post_match]]
next
- elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line
- line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
+ elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line
+ line.sub!(%r'(\s)*\#.*$', '')
+ comment = $& || ''
+ line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
+ line = line.chomp + comment + "\n"
end
depout << line
end