Skip to content

Commit

Permalink
Correctly report which version of libncurses was linked
Browse files Browse the repository at this point in the history
Later versions of ncurses (20111030 and up) support NCURSES_WIDECHAR even when
compiling with libncurses instead of libncursesw.

Have tig correctly report whether it was linked against libncursesw or
libncurses based off the same defines we set in the build script and use to
determine which headers to include.

Per the build system, either of HAVE_NCURSESW_H or HAVE_NCURSESW_CURSES_H may
indicate the presence of ncursesw, so both are checked.

(See #1240 as an example of where `tig --version` incorrectly reports `ncursesw`
instead of `ncurses`).
  • Loading branch information
mqudsi committed Nov 20, 2022
1 parent 06f7d75 commit 5636769
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tig.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ parse_options(int argc, const char *argv[], bool pager_mode)
printf("tig version %s\n", TIG_VERSION);
#ifdef NCURSES_VERSION
printf("%s version %s.%d\n",
#ifdef NCURSES_WIDECHAR
#if defined(HAVE_NCURSESW_CURSES_H) || defined(HAVE_NCURSESW_H)
"ncursesw",
#else
"ncurses",
Expand Down

0 comments on commit 5636769

Please sign in to comment.