]> git.deb.at Git - pkg/netris.git/blobdiff - debian/patches/03_staircase-effect-fix
Imported Debian patch 0.52-7
[pkg/netris.git] / debian / patches / 03_staircase-effect-fix
diff --git a/debian/patches/03_staircase-effect-fix b/debian/patches/03_staircase-effect-fix
new file mode 100644 (file)
index 0000000..514e867
--- /dev/null
@@ -0,0 +1,51 @@
+Author: Per von Zweigbergk <pvz@e.kth.se>      vim:ft=diff:
+Description: fix staircase effect in error message, BTS #83039
+
+Index: netris-0.52/util.c
+===================================================================
+--- netris-0.52.orig/util.c
++++ netris-0.52/util.c
+@@ -267,6 +267,7 @@ ExtFunc volatile void die(char *msg)
+ ExtFunc volatile void fatal(char *msg)
+ {
++      CleanupScreens ();
+       fprintf(stderr, "%s\n", msg);
+       exit(1);
+ }
+Index: netris-0.52/curses.c
+===================================================================
+--- netris-0.52.orig/curses.c
++++ netris-0.52/curses.c
+@@ -57,6 +57,7 @@ static EventGenRec keyGen =
+ static int boardYPos[MAX_SCREENS], boardXPos[MAX_SCREENS];
+ static int statusYPos, statusXPos;
+ static int haveColor;
++static int screens_dirty = 0;
+ static char *term_vi; /* String to make cursor invisible */
+ static char *term_ve; /* String to make cursor visible */
+@@ -98,6 +99,7 @@ ExtFunc void InitScreens(void)
+ #endif
+       AtExit(CleanupScreens);
++      screens_dirty = 1;
+       RestoreSignals(NULL, &oldMask);
+       cbreak();
+@@ -116,9 +118,12 @@ ExtFunc void InitScreens(void)
+ ExtFunc void CleanupScreens(void)
+ {
+-      RemoveEventGen(&keyGen);
+-      endwin();
+-      OutputTermStr(term_ve, 1);
++      if (screens_dirty) {
++              RemoveEventGen(&keyGen);
++              endwin();
++              OutputTermStr(term_ve, 1);
++              screens_dirty = 0;
++      }
+ }
+ ExtFunc void GetTermcapInfo(void)