Browse Source

Parse obs-config.h version string to just the hash

jp9000 11 years ago
parent
commit
b7e0c9fb22
1 changed files with 13 additions and 1 deletions
  1. 13 1
      obs/obs-app.cpp

+ 13 - 1
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