annotate src/readline-1-display.patch @ 5031:5049ab5e66f6

Re-add readline patches to work with readline 8 (Bug #55957) * src/readline-1-display.patch, src/readline-1-input.patch, src/readline-1-sigwinch.patch, src/readline-2-event-hook.patch dist-files.mk: add refes to added files
author John Donoghue
date Thu, 21 Mar 2019 09:34:09 -0400
parents
children 41e50d658de0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5031
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
1 diff -ur readline-8.0.orig/display.c readline-8.0.disp/display.c
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
2 --- readline-8.0.orig/display.c 2019-03-20 07:41:37.573786782 -0400
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
3 +++ readline-8.0.disp/display.c 2019-03-20 17:00:29.866659451 -0400
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
4 @@ -59,6 +59,11 @@
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
5 #include "rlprivate.h"
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
6 #include "xmalloc.h"
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
7
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
8 +#if defined (_WIN32)
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
9 +#include <windows.h>
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
10 +#define hStdout GetStdHandle(STD_OUTPUT_HANDLE)
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
11 +#endif
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
12 +
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
13 #if !defined (strchr) && !defined (__STDC__)
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
14 extern char *strchr (), *strrchr ();
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
15 #endif /* !strchr && !__STDC__ */
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
16 @@ -2367,6 +2372,20 @@
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
17 int in_invisline;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
18 int mb_cur_max = MB_CUR_MAX;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
19
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
20 +#if defined (_WIN32)
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
21 + CONSOLE_SCREEN_BUFFER_INFO csbi;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
22 + if (_rl_last_c_pos != new
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
23 + && GetConsoleScreenBufferInfo (hStdout, &csbi))
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
24 + {
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
25 + csbi.dwCursorPosition.X += new - _rl_last_c_pos;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
26 + if (SetConsoleCursorPosition(hStdout, csbi.dwCursorPosition))
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
27 + {
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
28 + _rl_last_c_pos = new;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
29 + return;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
30 + }
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
31 + }
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
32 +#endif /* !_WIN32 */
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
33 +
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
34 woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset);
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
35 cpos = _rl_last_c_pos;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
36
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
37 @@ -2519,6 +2538,20 @@
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
38 {
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
39 register int delta, i;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
40
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
41 +#if defined (_WIN32)
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
42 + CONSOLE_SCREEN_BUFFER_INFO csbi;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
43 + if (_rl_last_v_pos != to && to <= _rl_screenheight
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
44 + && GetConsoleScreenBufferInfo(hStdout, &csbi))
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
45 + {
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
46 + csbi.dwCursorPosition.Y += to - _rl_last_v_pos;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
47 + if (SetConsoleCursorPosition(hStdout, csbi.dwCursorPosition))
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
48 + {
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
49 + _rl_last_v_pos = to;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
50 + return;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
51 + }
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
52 + }
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
53 +#endif /* !_WIN32 */
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
54 +
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
55 if (_rl_last_v_pos == to || to > _rl_screenheight)
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
56 return;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
57
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
58 @@ -2848,6 +2881,17 @@
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
59 void
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
60 _rl_clear_to_eol (int count)
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
61 {
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
62 +#if defined (_WIN32)
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
63 + CONSOLE_SCREEN_BUFFER_INFO csbi;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
64 + if (GetConsoleScreenBufferInfo (hStdout, &csbi))
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
65 + {
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
66 + DWORD written;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
67 + FillConsoleOutputCharacter(hStdout, ' ', count, csbi.dwCursorPosition,
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
68 + &written);
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
69 + return;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
70 + }
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
71 +#endif /* !_WIN32 */
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
72 +
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
73 #ifndef __MSDOS__
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
74 if (_rl_term_clreol)
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
75 tputs (_rl_term_clreol, 1, _rl_output_character_function);
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
76 @@ -2873,6 +2917,33 @@
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
77 void
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
78 _rl_clear_screen (void)
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
79 {
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
80 +#if defined (_WIN32)
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
81 + COORD coordScreen = { 0, 0 };
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
82 + DWORD cCharsWritten;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
83 + CONSOLE_SCREEN_BUFFER_INFO csbi;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
84 + DWORD dwConSize;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
85 +
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
86 + if (GetConsoleScreenBufferInfo (hStdout, &csbi))
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
87 + {
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
88 + dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
89 +
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
90 + if (FillConsoleOutputCharacter (hStdout, (TCHAR) ' ', dwConSize,
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
91 + coordScreen, &cCharsWritten))
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
92 + {
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
93 + if (GetConsoleScreenBufferInfo (hStdout, &csbi))
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
94 + {
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
95 + if (FillConsoleOutputAttribute (hStdout, csbi.wAttributes,
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
96 + dwConSize, coordScreen,
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
97 + &cCharsWritten))
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
98 + {
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
99 + SetConsoleCursorPosition (hStdout, coordScreen);
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
100 + return;
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
101 + }
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
102 + }
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
103 + }
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
104 + }
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
105 +#endif
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
106 +
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
107 #if defined (__DJGPP__)
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
108 ScreenClear ();
5049ab5e66f6 Re-add readline patches to work with readline 8 (Bug #55957)
John Donoghue
parents:
diff changeset
109 ScreenSetCursor (0, 0);