From: Christoph Moench-Tegeder <c...@freebsd.org> Here's the rub: with TERM=xterm (or rxvt, for that matter), Km ("key_mouse", "Mouse event has occured") is not set (and therefore NULL), but InitTermcap() (termcap.c:230) happily tries to strdup() that, which gets us that segfault.
As a band-aid, catch that NULL and don't strdup(). Signed-off-by: Marcin Cieślak <sa...@saper.info> --- src/termcap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/termcap.c b/src/termcap.c index 0253cf1..93b3d01 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -178,7 +178,7 @@ int InitTermcap(int width, int height) if (strstr(D_termname, "xterm") || strstr(D_termname, "rxvt") || (D_CKM && (strstr(D_CKM, "\033[M") || strstr(D_CKM, "\033[<")))) { D_CXT = 1; - kmapdef[0] = SaveStr(D_CKM); + kmapdef[0] = D_CKM ? SaveStr(D_CKM) : NULL; } /* "be" seems to be standard for xterms... */ if (D_CXT) -- 2.23.0