[w3m-dev 04012] Re: Bug#217509: segfaults if TERM is not set
Fumitoshi UKAI <[email protected]>
| Newsgroups | gmane.comp.web.w3m.devel |
|---|---|
| Organization | Debian JP Project |
| Message-ID | <[email protected]> |
Bug#217509 http://bugs.debian.org/217509
Index: terms.c
===================================================================
RCS file: /cvsroot/w3m/w3m/terms.c,v
retrieving revision 1.50
diff -u -u -p -r1.50 terms.c
--- terms.c 5 Oct 2003 18:52:51 -0000 1.50
+++ terms.c 25 Oct 2003 19:22:32 -0000
@@ -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
--