From afa10bd12533b1f42b609a055e94f520005d88c6 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 21 Nov 2017 08:48:07 +0000 Subject: [PATCH] Skip comment lines * template/prelude.c.tmpl (translate): empty (only LF) lines are not necessary. so skip them, but for safety only when they are made from comment line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- template/prelude.c.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/template/prelude.c.tmpl b/template/prelude.c.tmpl index ef024fd05c..34763cc730 100644 --- a/template/prelude.c.tmpl +++ b/template/prelude.c.tmpl @@ -42,6 +42,7 @@ class Prelude result = [@preludes.size, @vpath.strip(filename), lines, sub] @vpath.foreach(filename) do |line| @preludes[filename] ||= result + next if /\A\s*\#.*\n\z/ =~ line line.sub!(/(?:^|\s+)\#(?:$|[#\s].*)/, '') line.sub!(/require(_relative)?\s*\(?\s*(["'])(.*?)(?:\.rb)?\2\)?/) do orig, rel, path = $&, $2, $3