Code

Check the ncurses version before using set_tabsize
authorKumar Appaiah <a.kumar@alumni.iitm.ac.in>
Mon, 20 Sep 2010 23:10:11 +0000 (18:10 -0500)
committerJonas Fonseca <fonseca@diku.dk>
Tue, 21 Sep 2010 12:43:02 +0000 (08:43 -0400)
This patch checks the ncurses patch level to decide if set_tabsize is
to be used in place of the TABSIZE macro, for setting the tab size.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
NEWS
tig.c

diff --git a/NEWS b/NEWS
index c8c94d9805d1a9079311927b25ae6f744ddf6848..a9cbe076932048fa8120650e911664f9b09f15b2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,13 @@
 Release notes
 =============
 
+tig master
+----------
+
+Bug fixes:
+
+ - Fix set_tabsize() compile error for older versions of ncurses.
+
 tig-0.16.1
 ----------
 
diff --git a/tig.c b/tig.c
index 7bc5daaaeeb440018bcb7642e42af11c66ea63ad..01b55d74b81994856e3da0cf779e52c97a36615e 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -7111,7 +7111,11 @@ init_display(void)
        keypad(status_win, TRUE);
        wbkgdset(status_win, get_line_attr(LINE_STATUS));
 
+#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20080119)
        set_tabsize(opt_tab_size);
+#else
+       TABSIZE = opt_tab_size;
+#endif
 
        term = getenv("XTERM_VERSION") ? NULL : getenv("COLORTERM");
        if (term && !strcmp(term, "gnome-terminal")) {