Module Name:    src
Committed By:   christos
Date:           Sun Dec 15 16:21:57 UTC 2024

Modified Files:
        src/external/gpl3/gdb/dist/gdb/tui: tui-winsource.c

Log Message:
PR/58894: Martin Husemann: refresh_window is meant to be called with a NULL
window, but our curses functions don't like to be passed a NULL window.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/tui/tui-winsource.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/tui/tui-winsource.c
diff -u src/external/gpl3/gdb/dist/gdb/tui/tui-winsource.c:1.6 src/external/gpl3/gdb/dist/gdb/tui/tui-winsource.c:1.7
--- src/external/gpl3/gdb/dist/gdb/tui/tui-winsource.c:1.6	Mon Aug 12 18:09:33 2024
+++ src/external/gpl3/gdb/dist/gdb/tui/tui-winsource.c	Sun Dec 15 11:21:57 2024
@@ -316,7 +316,7 @@ tui_source_window_base::refresh_window (
      the screen, potentially creating a flicker.  */
   wnoutrefresh (handle.get ());
 
-  int pad_width = getmaxx (m_pad.get ());
+  int pad_width = m_pad.get () ? getmaxx (m_pad.get ()) : 0;
   int left_margin = this->left_margin ();
   int view_width = this->view_width ();
   int content_width = m_max_length;
@@ -345,7 +345,8 @@ tui_source_window_base::refresh_window (
   int smincol = x + box_width () + left_margin;
   int smaxrow = sminrow + m_content.size () - 1;
   int smaxcol = smincol + view_width - 1;
-  prefresh (m_pad.get (), 0, pad_x, sminrow, smincol, smaxrow, smaxcol);
+  if (m_pad.get ())
+    prefresh (m_pad.get (), 0, pad_x, sminrow, smincol, smaxrow, smaxcol);
 }
 
 void

Reply via email to