]> git.sur5r.net Git - i3/i3/blob - libi3/is_debug_build.c
Merge branch 'fix-dump-log-errmsg'
[i3/i3] / libi3 / is_debug_build.c
1 #include <string.h>
2 #include <stdbool.h>
3
4 /*
5  * Returns true if this version of i3 is a debug build (anything which is not a
6  * release version), based on the git version number.
7  *
8  */
9 bool is_debug_build() {
10     /* i3_version contains either something like this:
11      *     "4.0.2 (2011-11-11, branch "release")".
12      * or: "4.0.2-123-gCOFFEEBABE (2011-11-11, branch "next")".
13      *
14      * So we check for the offset of the first opening round bracket to
15      * determine whether this is a git version or a release version. */
16     return ((strchr(I3_VERSION, '(') - I3_VERSION) > 10);
17 }