ruby-changes:56382
From: Nobuyoshi <ko1@a...>
Date: Sun, 7 Jul 2019 19:03:31 +0900 (JST)
Subject: [ruby-changes:56382] Nobuyoshi Nakada: 19a4c42d61 (master): Unescape #{} in the last commit title
https://git.ruby-lang.org/ruby.git/commit/?id=19a4c42d61 From 19a4c42d6124aa3bcdf2cd53d510b22acb2b5104 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 7 Jul 2019 18:54:17 +0900 Subject: 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' ^~ ``` diff --git a/tool/file2lastrev.rb b/tool/file2lastrev.rb index 44c4318..eb0cd56 100755 --- a/tool/file2lastrev.rb +++ b/tool/file2lastrev.rb @@ -72,7 +72,8 @@ vcs = nil https://github.com/ruby/ruby/blob/trunk/tool/file2lastrev.rb#L72 "#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"') -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/