typo
[exim.git] / src / exim_monitor / em_version.c
CommitLineData
059ec3d9
PH
1/*************************************************
2* Exim Monitor *
3*************************************************/
4
f9ba5e22 5/* Copyright (c) University of Cambridge 1995 - 2018 */
059ec3d9
PH
6/* See the file NOTICE for conditions of use and distribution. */
7
8#include "mytypes.h"
e59797e3 9#include "store.h"
059ec3d9
PH
10#include "macros.h"
11#include <string.h>
12#include <stdlib.h>
13
a6f7862b
AM
14#include "version.h"
15
059ec3d9
PH
16extern uschar *version_string;
17extern uschar *version_date;
18
19void
20version_init(void)
21{
22int i = 0;
23uschar today[20];
24
f3f065bb 25version_string = US"2.06";
059ec3d9 26
a6f7862b
AM
27#ifdef EXIM_BUILD_DATE_OVERRIDE
28/* Reproducible build support; build tooling should have given us something looking like
29 * "25-Feb-2017 20:15:40" in EXIM_BUILD_DATE_OVERRIDE based on $SOURCE_DATE_EPOCH in environ
30 * per <https://reproducible-builds.org/specs/source-date-epoch/>
31 */
32version_date = US malloc(32);
33version_date[0] = 0;
34Ustrncat(version_date, EXIM_BUILD_DATE_OVERRIDE, 31);
35
36#else
f3ebb786 37Ustrcpy(today, US __DATE__);
059ec3d9
PH
38if (today[4] == ' ') i = 1;
39today[3] = today[6] = '-';
40
5903c6ff 41version_date = US malloc(32);
059ec3d9
PH
42version_date[0] = 0;
43Ustrncat(version_date, today+4+i, 3-i);
44Ustrncat(version_date, today, 4);
45Ustrncat(version_date, today+7, 4);
f3ebb786
JH
46Ustrcat(version_date, US" ");
47Ustrcat(version_date, US __TIME__);
a6f7862b 48#endif
059ec3d9
PH
49}
50
51/* End of em_version.c */