File: avoid-accessing-internal-ncurses-structures.patch

package info (click to toggle)
bosh 0.6-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 612 kB
  • sloc: ansic: 2,008; sh: 1,005; makefile: 14
file content (30 lines) | stat: -rw-r--r-- 934 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 4e13fe3db4df26574709c107a24bed9eb8b1924b Mon Sep 17 00:00:00 2001
From: Sven Joachim <svenjoac@gmx.de>
Date: Sat, 16 Dec 2023 19:30:56 +0100
Subject: [PATCH] Avoid accessing internal ncurses structures

Since ncurses patchlevel 20231021 the WINDOW structure is opaque, its
members cannot be addressed directly.  Use the functions ncurses
provides for this purpose instead.
---
 bosh.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bosh.c b/bosh.c
index 7c634a4..4133c18 100644
--- a/bosh.c
+++ b/bosh.c
@@ -450,8 +450,8 @@ int *keyhandler_readstr(int key) {
     case KEY_BACKSPACE:
       if(strlen(REPLY)) {
         REPLY[strlen(REPLY)-1] = 0;
-        mvaddch(stdscr->_cury,stdscr->_curx-1,' ');
-        move(stdscr->_cury,stdscr->_curx-1);
+        mvaddch(getcury(stdscr),getcurx(stdscr)-1,' ');
+        move(getcury(stdscr),getcurx(stdscr)-1);
       }
       break;
     case '\n':
--
2.43.0