commit 1264065de5cca661aff86630df7ed62ffce3b25e
parent 8d92dfafba8f1b10a1d917c7a3e6a84d755a3541
Author: ukai <ukai>
Date: Mon, 8 Dec 2003 16:06:33 +0000
Bug#217509: segfaults if TERM is not set
* terms.c (check_cygwin_console): check TERM==NULL
(set_tty): check TERM==NULL
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat:
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,9 @@
+2003-10-26 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * Bug#217509: segfaults if TERM is not set
+ * terms.c (check_cygwin_console): check TERM==NULL
+ (set_tty): check TERM==NULL
+
2003-10-23 ABE Yuji <cbo46560@pop12.odn.ne.jp>
* [w3m-dev 04011] accessing to an `https' URI with a fragment via a proxy
diff --git a/terms.c b/terms.c
@@ -220,7 +220,9 @@ check_cygwin_console(void)
char *term = getenv("TERM");
HANDLE hWnd;
- if (strncmp(term, "cygwin", 6) == 0) {
+ if (term == NULL)
+ term = DEFAULT_TERM;
+ if (term && strncmp(term, "cygwin", 6) == 0) {
isWinConsole = 1;
}
if (isWinConsole) {
@@ -485,12 +487,14 @@ set_tty(void)
#ifdef USE_MOUSE
{
char *term = getenv("TERM");
- struct w3m_term_info *p;
- for (p = w3m_term_info_list; p->term != NULL; p++) {
- if (!strncmp(term, p->term, strlen(p->term))) {
- is_xterm = p->mouse_flag;
- break;
- }
+ if (term != NULL) {
+ struct w3m_term_info *p;
+ for (p = w3m_term_info_list; p->term != NULL; p++) {
+ if (!strncmp(term, p->term, strlen(p->term))) {
+ is_xterm = p->mouse_flag;
+ break;
+ }
+ }
}
}
#endif