Control: tags 1057935 + pending
--

Dear maintainer,

I've prepared an NMU for ncurses-hexedit (versioned as 0.9.7+orig-7.3) and
uploaded it to DELAYED/2. Please feel free to tell me if I
should delay it longer.

-- 
Regards
Sudip

diff -Nru ncurses-hexedit-0.9.7+orig/debian/changelog 
ncurses-hexedit-0.9.7+orig/debian/changelog
--- ncurses-hexedit-0.9.7+orig/debian/changelog 2023-02-10 00:03:53.000000000 
+0000
+++ ncurses-hexedit-0.9.7+orig/debian/changelog 2024-01-05 15:59:12.000000000 
+0000
@@ -1,3 +1,11 @@
+ncurses-hexedit (0.9.7+orig-7.3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * d/p/ncurses_ftbfs.patch:
+    Stop using fields of opaque _WINDOW struct (Closes: #1057935)
+
+ -- Mate Kukri <mate.ku...@canonical.com>  Fri, 05 Jan 2024 15:59:12 +0000
+
 ncurses-hexedit (0.9.7+orig-7.2) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru ncurses-hexedit-0.9.7+orig/debian/patches/fix_ncurses_ftbfs.patch 
ncurses-hexedit-0.9.7+orig/debian/patches/fix_ncurses_ftbfs.patch
--- ncurses-hexedit-0.9.7+orig/debian/patches/fix_ncurses_ftbfs.patch   
1970-01-01 01:00:00.000000000 +0100
+++ ncurses-hexedit-0.9.7+orig/debian/patches/fix_ncurses_ftbfs.patch   
2024-01-05 15:59:12.000000000 +0000
@@ -0,0 +1,175 @@
+Description: Stop using fields of opaque _WINDOW struct
+Author: Mate Kukri <mate.ku...@canonical.com>
+Last-Update: 2024-01-08
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/widgets.c
++++ b/src/widgets.c
+@@ -99,11 +99,11 @@
+          case KEY_LEFT:
+             if (i > 0)
+             {
+-               if (win->_curx > x)
++               if (getcurx(win) > x)
+                /* not at left hand side */
+                {
+                   i--;
+-                  wmove (win, y, win->_curx - 1);
++                  wmove (win, y, getcurx(win) - 1);
+                }
+                else if (i > 0)
+                /* left hand side */
+@@ -128,11 +128,11 @@
+             }
+             break;
+          case KEY_RIGHT:
+-            if (win->_curx < (x + max - 1))
++            if (getcurx(win) < (x + max - 1))
+             /* not at right hand side */
+             {
+                i++;
+-               wmove (win, y, win->_curx + 1);
++               wmove (win, y, getcurx(win) + 1);
+             }
+             else if (i < len - 1)
+             /* right hand side */
+@@ -163,7 +163,7 @@
+ #endif
+             if (i > 0)
+             {
+-               if (win->_curx > x)
++               if (getcurx(win) > x)
+                /* not at left hand side */
+                {
+                   i--;
+@@ -172,7 +172,7 @@
+                   for (n = i; n < len; n++)
+                      *(str + n) = *(str + n + 1);
+                   *(str + n) = 0;
+-                  oldx = win->_curx;
++                  oldx = getcurx(win);
+                   wmove (win, y, x);
+                   for (n = left; n <= right; n++)
+                   {
+@@ -209,8 +209,8 @@
+                do_beep ();
+             break;
+          case SPACEBAR:
+-            oldx = win->_curx;
+-            if ((win->_curx < x + max - 1)
++            oldx = getcurx(win);
++            if ((getcurx(win) < x + max - 1)
+              && (i < len - 1) && (*(str + len - 1) <= ' '))
+             {
+                for (n = len - 1; n > i; n--)
+@@ -230,7 +230,7 @@
+                }
+                wmove (win, y, oldx + 1);
+             }
+-            else if ((win->_curx == x + max - 1)
++            else if ((getcurx(win) == x + max - 1)
+              && (i < len - 1) && (*(str + len - 1) <= ' '))
+             {
+                for (n = len - 1; n > i; n--)
+@@ -255,7 +255,7 @@
+                }
+                wmove (win, y, x + max - 1);      
+             }
+-            else if ((win->_curx == x + max - 1)
++            else if ((getcurx(win) == x + max - 1)
+              && (i == len - 1))
+             {
+                *(str + len - 1) = ' ';
+@@ -285,12 +285,12 @@
+          default: /* normal input */
+             if (isprintable (in))
+             {
+-               if (win->_curx != (x + max - 1))
++               if (getcurx(win) != (x + max - 1))
+                /* not at right hand side */
+                {
+                   *(str + i) = in;
+                   i++;
+-                  oldx = win->_curx;
++                  oldx = getcurx(win);
+                   wmove (win, y, x);
+                   for (n = left; n <= right; n++)
+                   {
+--- a/src/file.c
++++ b/src/file.c
+@@ -644,7 +644,7 @@
+       wprintw (Globals.wmain, "%s", trunc_file);
+       fp = fp->p;
+ 
+-      for (result = Globals.wmain->_curx; result < COLS; result++)
++      for (result = getcurx(Globals.wmain); result < COLS; result++)
+          wprintw (Globals.wmain, " ");
+    }
+ 
+--- a/src/misc.c
++++ b/src/misc.c
+@@ -641,10 +641,8 @@
+    if (!newlines)
+       die_horribly (NOT_ENOUGH_MEMORY, NULL);
+ 
+-   Globals.wmain->_cury = cursor_y - 1;
+-   Globals.wmain->_curx = cursor_x;
+-   stdscr->_cury = cursor_y;
+-   stdscr->_curx = cursor_x;
++   wmove(Globals.wmain, cursor_y - 1, cursor_x);
++   wmove(stdscr, cursor_y, cursor_x);
+    if (cursor_y >= BOTTOM_LINE)
+       cursor_y = BOTTOM_LINE;
+    if (Globals.mode == FILE_MODE)
+--- a/src/print.c
++++ b/src/print.c
+@@ -196,16 +196,16 @@
+       if (*offs > Globals.filesize)
+          break;
+ #ifdef __NCURSES_H     /* i don't know why this works */
+-      if (Globals.wmain->_cury == MAIN_BOTTOM_LINE)
++      if (getcury(Globals.wmain) == MAIN_BOTTOM_LINE)
+ #else
+-      if (Globals.wmain->_cury == MAIN_HEIGHT)
++      if (getcury(Globals.wmain) == MAIN_HEIGHT)
+ #endif
+          break;
+-      if (Globals.wmain->_curx == COLS - 2)
++      if (getcurx(Globals.wmain) == COLS - 2)
+       {
+          move = 1;
+       }
+-      if (Globals.wmain->_curx == 0)
++      if (getcurx(Globals.wmain) == 0)
+          *(newlines + i++) = *offs;
+       bold = hash_lookup (*offs, NULL);
+       if (!bold)
+@@ -215,8 +215,8 @@
+       {
+          if (filebuffer (*offs) == '\n')
+          {
+-            int cury = Globals.wmain->_cury;
+-            int i = Globals.wmain->_curx;
++            int cury = getcury(Globals.wmain);
++            int i = getcurx(Globals.wmain);
+             for (; i < COLS - 2; i++)
+                wprintw (Globals.wmain, " ");
+             wprintw (Globals.wmain, ".");
+@@ -235,7 +235,7 @@
+       {
+          if (filebuffer (*offs) == EBCDIC['\n'])
+          {
+-            int cury = Globals.wmain->_cury;
++            int cury = getcury(Globals.wmain);
+             wprintw (Globals.wmain, ".");
+             wmove (Globals.wmain, cury + 1, 0);
+          }
+@@ -257,7 +257,7 @@
+       (*offs)++;
+       if (move)
+       {
+-         wmove (Globals.wmain, Globals.wmain->_cury + 1, 0);
++         wmove (Globals.wmain, getcury(Globals.wmain) + 1, 0);
+          move = 0;
+          continue;
+       }
diff -Nru ncurses-hexedit-0.9.7+orig/debian/patches/series 
ncurses-hexedit-0.9.7+orig/debian/patches/series
--- ncurses-hexedit-0.9.7+orig/debian/patches/series    2023-02-10 
00:01:23.000000000 +0000
+++ ncurses-hexedit-0.9.7+orig/debian/patches/series    2024-01-05 
15:59:12.000000000 +0000
@@ -18,3 +18,4 @@
 fix_spelling_errors.patch
 gcc_10.patch
 ncurses.patch
+fix_ncurses_ftbfs.patch

Reply via email to