aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Poeml <poeml@suse.de>2014-12-06 07:50:16 +0000
committerTatsuya Kinoshita <tats@debian.org>2014-12-06 07:50:16 +0000
commitc6f15256e92b79252c33d01623370effbf5cdb3f (patch)
treeac8c1c35c0205bb301a3021db3db8e45c759c40e
parentMerge branch 'feature/w3m-img-freebsd' (diff)
downloadw3m-c6f15256e92b79252c33d01623370effbf5cdb3f.tar.gz
w3m-c6f15256e92b79252c33d01623370effbf5cdb3f.zip
Prevent segfault when editing a textarea field with vi
add fix for segfault that can occur when editing a textarea field with vi, and returning to w3m (it seems to happen if the terminal is not writable, as when using w3m after 'su - some_user') Origin: https://build.opensuse.org/package/view_file/openSUSE:Factory/w3m/w3m-0.4.1-textarea-segfault.dif?expand=1
Diffstat (limited to '')
-rw-r--r--terms.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/terms.c b/terms.c
index ca81d28..672262c 100644
--- a/terms.c
+++ b/terms.c
@@ -637,7 +637,8 @@ reset_tty(void)
writestr(T_se); /* reset terminal */
flush_tty();
TerminalSet(tty, &d_ioval);
- close_tty();
+ if (tty != 2)
+ close_tty();
}
static MySignalHandler