aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-12-08 16:06:33 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-12-08 16:06:33 +0000
commita850e05763c196efb9325e6ce0455add9b34bdb9 (patch)
treec766bfcaafe748053e6be98cee4f27c350892ff9
parent[w3m-dev 04011] accessing to an `https' URI with a fragment via a proxy (diff)
downloadw3m-a850e05763c196efb9325e6ce0455add9b34bdb9.tar.gz
w3m-a850e05763c196efb9325e6ce0455add9b34bdb9.zip
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 (limited to '')
-rw-r--r--ChangeLog8
-rw-r--r--terms.c20
2 files changed, 19 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index aceb389..ca58aa0 100644
--- 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
@@ -8255,4 +8261,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.890 2003/10/22 18:48:09 ukai Exp $
+$Id: ChangeLog,v 1.891 2003/12/08 16:06:33 ukai Exp $
diff --git a/terms.c b/terms.c
index f8aa8be..63963ff 100644
--- a/terms.c
+++ b/terms.c
@@ -1,4 +1,4 @@
-/* $Id: terms.c,v 1.50 2003/10/05 18:52:51 ukai Exp $ */
+/* $Id: terms.c,v 1.51 2003/12/08 16:06:34 ukai Exp $ */
/*
* An original curses library for EUC-kanji by Akinori ITO, December 1989
* revised by Akinori ITO, January 1995
@@ -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