From b7e0c9fb22fa679139b90b5a99534f58a8dc8bce Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 14 Jul 2014 09:04:05 -0700 Subject: [PATCH] Parse obs-config.h version string to just the hash --- obs/obs-app.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/obs/obs-app.cpp b/obs/obs-app.cpp index df07d47fa..8b8fa02ff 100644 --- a/obs/obs-app.cpp +++ b/obs/obs-app.cpp @@ -281,7 +281,19 @@ string OBSApp::GetVersionString() const ver << " ("; #ifdef HAVE_OBSCONFIG_H - ver << OBS_VERSION << ", "; + const char *hash = OBS_VERSION; + const char *temp = hash; + + /* only use the commit hash from the OBS_VERSION string */ + while (temp) { + if (*temp == '-') + temp++; + + hash = temp; + temp = strchr(temp, '-'); + } + + ver << hash << ", "; #endif #ifdef _WIN32