Show commit id in version for git builds.

This commit is contained in:
Alexey Sokolov
2012-07-20 22:34:53 +07:00
parent a88d9c7a7f
commit a131127770
8 changed files with 42 additions and 18 deletions
+8
View File
@@ -0,0 +1,8 @@
#include <znc/version.h>
#ifdef VERSION_EXTRA
const char* ZNC_VERSION_EXTRA = VERSION_EXTRA;
#else
const char* ZNC_VERSION_EXTRA = "";
#endif
+2 -2
View File
@@ -72,7 +72,7 @@ CZNC::~CZNC() {
CString CZNC::GetVersion() {
char szBuf[128];
snprintf(szBuf, sizeof(szBuf), "%1.3f"VERSION_EXTRA, VERSION);
snprintf(szBuf, sizeof(szBuf), "%1.3f%s", VERSION, ZNC_VERSION_EXTRA);
// If snprintf overflows (which I doubt), we want to be on the safe side
szBuf[sizeof(szBuf) - 1] = '\0';
@@ -87,7 +87,7 @@ CString CZNC::GetTag(bool bIncludeVersion, bool bHTML) {
}
char szBuf[128];
snprintf(szBuf, sizeof(szBuf), "ZNC %1.3f"VERSION_EXTRA" - ", VERSION);
snprintf(szBuf, sizeof(szBuf), "ZNC %1.3f%s - ", VERSION, ZNC_VERSION_EXTRA);
// If snprintf overflows (which I doubt), we want to be on the safe side
szBuf[sizeof(szBuf) - 1] = '\0';