summaryrefslogtreecommitdiff
path: root/tool/file2lastrev.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-07 18:54:17 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-07 19:01:48 +0900
commit19a4c42d6124aa3bcdf2cd53d510b22acb2b5104 (patch)
treec11c3a485556503344117a20edba0f449a168de7 /tool/file2lastrev.rb
parent68e580402272cea7f98145c3c562cab565a37046 (diff)
downloadruby-19a4c42d6124aa3bcdf2cd53d510b22acb2b5104.tar.gz
Unescape #{} in the last commit title
Get rid of unknown escape sequence warning, as `#` is not a special character in C. ``` version.c:126:26: warning: unknown escape sequence '\#' [-Wunknown-escape-sequence] fputs("last_commit=" RUBY_LAST_COMMIT_TITLE, stdout); ^~~~~~~~~~~~~~~~~~~~~~ revision.h:4:42: note: expanded from macro 'RUBY_LAST_COMMIT_TITLE' ^~ ```
Diffstat (limited to 'tool/file2lastrev.rb')
-rwxr-xr-xtool/file2lastrev.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/tool/file2lastrev.rb b/tool/file2lastrev.rb
index 44c4318cd8..eb0cd56319 100755
--- a/tool/file2lastrev.rb
+++ b/tool/file2lastrev.rb
@@ -72,7 +72,8 @@ vcs = nil
"#define RUBY_BRANCH_NAME #{name.dump}"
end,
if title
- "#define RUBY_LAST_COMMIT_TITLE #{title.dump}"
+ title = title.dump.sub(/\\#/, '#')
+ "#define RUBY_LAST_COMMIT_TITLE #{title}"
end,
if modified
modified.utc.strftime('#define RUBY_RELEASE_DATETIME "%FT%TZ"')