about summary refs log tree commit diff stats
path: root/src/windows.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-10-24 00:18:32 +0100
committerJames Booth <boothj5@gmail.com>2012-10-24 00:18:32 +0100
commitf1d641b5e13c16d5c5bb1cea528efdf929f2b7d3 (patch)
tree60b3a9865fb544df77b589181bf257c5eb9db5d7 /src/windows.c
parent83b0dc9f6d83827c3c8af67b060c632f9b099307 (diff)
downloadprofani-tty-f1d641b5e13c16d5c5bb1cea528efdf929f2b7d3.tar.gz
Only check for new release if release build
Diffstat (limited to 'src/windows.c')
-rw-r--r--src/windows.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/windows.c b/src/windows.c
index 0d87c378..97d85192 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -844,13 +844,23 @@ cons_about(void)
     wprintw(_cons_win, "Type '/help' to show complete help.\n");
     _win_show_time(_cons_win);
     wprintw(_cons_win, "\n");
-    
-    char *latest_release = release_get_latest();
-    _win_show_time(_cons_win);
-    wprintw(_cons_win, "RELEASE: %s", latest_release);
-    free(latest_release);
-    _win_show_time(_cons_win);
-    wprintw(_cons_win, "\n");
+
+    // check for new version if this is a release build
+    if (strcmp(PACKAGE_STATUS, "release") == 0) {
+        char *latest_release = release_get_latest();
+
+        if (latest_release != NULL) {
+            gboolean relase_valid = g_regex_match_simple("^\\d+\\.\\d+\\.\\d+$", latest_release, 0, 0);
+
+            if (relase_valid) {
+                _win_show_time(_cons_win);
+                wprintw(_cons_win, "RELEASE: %s", latest_release);
+                free(latest_release);
+                _win_show_time(_cons_win);
+                wprintw(_cons_win, "\n");
+            }
+        }
+    }
 
     prefresh(_cons_win, 0, 0, 1, 0, rows-3, cols-1);