]> git.deb.at Git - pkg/netris.git/blob - debian/patches/03_staircase-effect-fix
514e867280f937bda99dc92122ad7eec221948ca
[pkg/netris.git] / debian / patches / 03_staircase-effect-fix
1 Author: Per von Zweigbergk <pvz@e.kth.se>       vim:ft=diff:
2 Description: fix staircase effect in error message, BTS #83039
3
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)
9  
10  ExtFunc volatile void fatal(char *msg)
11  {
12 +       CleanupScreens ();
13         fprintf(stderr, "%s\n", msg);
14         exit(1);
15  }
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;
25  
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
30  
31         AtExit(CleanupScreens);
32 +       screens_dirty = 1;
33         RestoreSignals(NULL, &oldMask);
34  
35         cbreak();
36 @@ -116,9 +118,12 @@ ExtFunc void InitScreens(void)
37  
38  ExtFunc void CleanupScreens(void)
39  {
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 +       }
49  }
50  
51  ExtFunc void GetTermcapInfo(void)