only print revision in version header if it's non-zero

Sat, 25 Aug 2012 05:05:58 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sat, 25 Aug 2012 05:05:58 +0300
changeset 60
8834e4b6aebd
parent 59
891b9e6ee139
child 61
11451e7a2fe6

only print revision in version header if it's non-zero

main.cxx file | annotate | diff | comparison | revisions
--- a/main.cxx	Sat Aug 25 04:19:22 2012 +0300
+++ b/main.cxx	Sat Aug 25 05:05:58 2012 +0300
@@ -105,7 +105,12 @@
 	// Print header
 	str header;
 	str headerline = "-=";
-	header.appendformat ("%s version %d.%d.%d", APPNAME, VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION);
+	header.appendformat ("%s version %d.%d", APPNAME, VERSION_MAJOR, VERSION_MINOR);
+	
+	// Include revision if non-zero
+	if (VERSION_REVISION)
+		header.appendformat (".%d", VERSION_REVISION);
+	
 	headerline.repeat ((header.len()/2)-1);
 	headerline += '-';
 	printf ("%s\n%s\n", header.chars(), headerline.chars());

mercurial