updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / netris / 03_staircase-effect-fix.patch
blob514e867280f937bda99dc92122ad7eec221948ca
1 Author: Per von Zweigbergk <pvz@e.kth.se> vim:ft=diff:
2 Description: fix staircase effect in error message, BTS #83039
4 Index: netris-0.52/util.c
5 ===================================================================
6 --- netris-0.52.orig/util.c
7 +++ netris-0.52/util.c
8 @@ -267,6 +267,7 @@ ExtFunc volatile void die(char *msg)
10 ExtFunc volatile void fatal(char *msg)
12 + CleanupScreens ();
13 fprintf(stderr, "%s\n", msg);
14 exit(1);
16 Index: netris-0.52/curses.c
17 ===================================================================
18 --- netris-0.52.orig/curses.c
19 +++ netris-0.52/curses.c
20 @@ -57,6 +57,7 @@ static EventGenRec keyGen =
21 static int boardYPos[MAX_SCREENS], boardXPos[MAX_SCREENS];
22 static int statusYPos, statusXPos;
23 static int haveColor;
24 +static int screens_dirty = 0;
26 static char *term_vi; /* String to make cursor invisible */
27 static char *term_ve; /* String to make cursor visible */
28 @@ -98,6 +99,7 @@ ExtFunc void InitScreens(void)
29 #endif
31 AtExit(CleanupScreens);
32 + screens_dirty = 1;
33 RestoreSignals(NULL, &oldMask);
35 cbreak();
36 @@ -116,9 +118,12 @@ ExtFunc void InitScreens(void)
38 ExtFunc void CleanupScreens(void)
40 - RemoveEventGen(&keyGen);
41 - endwin();
42 - OutputTermStr(term_ve, 1);
43 + if (screens_dirty) {
44 + RemoveEventGen(&keyGen);
45 + endwin();
46 + OutputTermStr(term_ve, 1);
47 + screens_dirty = 0;
48 + }
51 ExtFunc void GetTermcapInfo(void)