From e4bb08e1f5ebf47620758795efcbdd61849b73e8 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Sun, 2 Aug 2009 20:47:35 +0000 Subject: [PATCH] Fix checking of setupterm(3) error codes. While there include the name of the terminal type causing the error where relevant. ok nicm@. --- tty-term.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tty-term.c b/tty-term.c index 0f50a269..c8b47783 100644 --- a/tty-term.c +++ b/tty-term.c @@ -186,13 +186,13 @@ tty_term_find(char *name, int fd, char **cause) /* Set up curses terminal. */ if (setupterm(name, fd, &error) != OK) { switch (error) { - case 0: - xasprintf(cause, "can't use hardcopy terminal"); - break; case 1: - xasprintf(cause, "missing or unsuitable terminal"); + xasprintf(cause, "can't use hardcopy terminal: %s", name); break; - case 2: + case 0: + xasprintf(cause, "missing or unsuitable terminal: %s", name); + break; + case -1: xasprintf(cause, "can't find terminfo database"); break; default: