]> git.sur5r.net Git - i3/i3/commit - configure.ac
Bugfix: escape I3_VERSION when read from file (#2517)
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Tue, 25 Oct 2016 20:35:30 +0000 (22:35 +0200)
committerGitHub <noreply@github.com>
Tue, 25 Oct 2016 20:35:30 +0000 (22:35 +0200)
commitc3b5bb929ee585df6484830ccfe254a1f38d906f
treeca803a963baad081189e6bddc16921b798e16c34
parent8ddc18756c892b003ff93dbc531d51a6ebbfb3f0
Bugfix: escape I3_VERSION when read from file (#2517)

I3_VERSION is used as string literal in config.h, i.e.:

    #define I3_VERSION …

Where “…” is replaced with the contents of I3_VERSION.

For our travis builds, we persist the version number to I3_VERSION,
i.e.:

    $ cat I3_VERSION
    4.12-150-g8ddc187 (2016-10-25, branch "next")

Previously, config.h would end up with:

    #define I3_VERSION "4.12-150-g8ddc187 (2016-10-25, branch "next")"

Note the unquoted double quotes around “next”, which are invalid in
C string literals.

Hence, this commit uses sed to escape double quotes, question marks and
backslashes (see also http://stackoverflow.com/a/12208808/712014).

The @<:@ and @:>@ quadrigraphs that m4 expands to [ and ], respectively,
see also http://stackoverflow.com/a/2309394/712014
configure.ac