summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-misc/screen/files/screen-4.2.0-check_for_altscreen.patch')
-rw-r--r--app-misc/screen/files/screen-4.2.0-check_for_altscreen.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/app-misc/screen/files/screen-4.2.0-check_for_altscreen.patch b/app-misc/screen/files/screen-4.2.0-check_for_altscreen.patch
new file mode 100644
index 000000000000..cb7ca5b0b0ab
--- /dev/null
+++ b/app-misc/screen/files/screen-4.2.0-check_for_altscreen.patch
@@ -0,0 +1,38 @@
+From 049a3bfdfc59590a24dfeefa707abb64b74ae17b Mon Sep 17 00:00:00 2001
+From: Amadeusz Sławiński <amade@asmblr.net>
+Date: Fri, 18 Apr 2014 18:28:39 +0000
+Subject: do proper checks if we are on altscreen or not
+
+fixes screen segfaults with `altscreen on` when using applications making
+use of altscreen like mc when resizing screen window
+
+Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
+---
+diff --git a/src/ansi.c b/src/ansi.c
+index 04c9012..e76eef4 100644
+--- a/src/ansi.c
++++ b/src/ansi.c
+@@ -1436,14 +1436,17 @@ int c, intermediate;
+ {
+ if (i)
+ {
+- if (!curr->w_alt.on)
++ if (!curr->w_alt.on) {
+ SaveCursor(&curr->w_alt.cursor);
+- EnterAltScreen(curr);
++ EnterAltScreen(curr);
++ }
+ }
+ else
+ {
+- LeaveAltScreen(curr);
+- RestoreCursor(&curr->w_alt.cursor);
++ if (curr->w_alt.on) {
++ LeaveAltScreen(curr);
++ RestoreCursor(&curr->w_alt.cursor);
++ }
+ }
+ if (a1 == 47 && !i)
+ curr->w_saved.on = 0;
+--
+cgit v0.9.0.2