summaryrefslogtreecommitdiff
path: root/user/networkmanager/editline.patch
blob: 7508e9b9a777151e05283738056a7d4eaf8b7d7a (plain) (blame)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
--- NetworkManager-1.18.1/clients/cli/agent.c.old	2019-04-18 09:19:11.000000000 +0000
+++ NetworkManager-1.18.1/clients/cli/agent.c	2019-05-10 06:15:55.614930112 +0000
@@ -9,8 +9,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <readline/readline.h>
-#include <readline/history.h>
+#include <editline/readline.h>
 
 #include "common.h"
 #include "utils.h"
--- NetworkManager-1.18.1/clients/cli/common.c.old	2019-04-20 19:01:59.000000000 +0000
+++ NetworkManager-1.18.1/clients/cli/common.c	2019-05-10 07:07:34.506620687 +0000
@@ -10,8 +10,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/ioctl.h>
-#include <readline/readline.h>
-#include <readline/history.h>
+#include <editline/readline.h>
 
 #include "nm-vpn-helpers.h"
 #include "nm-client-utils.h"
@@ -992,7 +991,7 @@
  * nmc_readline_echo:
  *
  * The same as nmc_readline() except it can disable echoing of input characters if @echo_on is %FALSE.
- * nmc_readline(TRUE, ...) == nmc_readline(...)
+ * nmc_readline_echo(TRUE, ...) == nmc_readline(...)
  */
 char *
 nmc_readline_echo (const NmcConfig *nmc_config,
@@ -1003,8 +1002,7 @@
 	va_list args;
 	gs_free char *prompt = NULL;
 	char *str;
-	HISTORY_STATE *saved_history;
-	HISTORY_STATE passwd_history = { 0, };
+	int whence, curpos;
 
 	va_start (args, prompt_fmt);
 	prompt = g_strdup_vprintf (prompt_fmt, args);
@@ -1014,8 +1012,7 @@
 
 	/* Hide the actual password */
 	if (!echo_on) {
-		saved_history = history_get_history_state ();
-		history_set_history_state (&passwd_history);
+		whence = where_history ();
 		rl_redisplay_function = nmc_secret_redisplay;
 	}
 
@@ -1024,7 +1021,10 @@
 	/* Restore the non-hiding behavior */
 	if (!echo_on) {
 		rl_redisplay_function = rl_redisplay;
-		history_set_history_state (saved_history);
+		curpos = where_history ();
+		for (; curpos > whence; curpos--) {
+			remove_history (curpos);
+		}
 	}
 
 	return str;
--- NetworkManager-1.18.1/clients/cli/connections.c.old	2019-04-20 19:01:59.000000000 +0000
+++ NetworkManager-1.18.1/clients/cli/connections.c	2019-05-10 07:05:43.058781503 +0000
@@ -12,8 +12,7 @@
 #include <unistd.h>
 #include <signal.h>
 #include <netinet/ether.h>
-#include <readline/readline.h>
-#include <readline/history.h>
+#include <editline/readline.h>
 #include <fcntl.h>
 
 #include "nm-client-utils.h"
@@ -6110,9 +6109,6 @@
 	return nmc_rl_gen_func_basic (text, state, avals);
 }
 
-/* from readline */
-extern int rl_complete_with_tilde_expansion;
-
 /*
  * Attempt to complete on the contents of TEXT.  START and END show the
  * region of TEXT that contains the word to complete.  We can use the
@@ -6139,9 +6135,6 @@
 	/* Disable default filename completion */
 	rl_attempted_completion_over = 1;
 
-	/* Enable tilde expansion when filenames are completed */
-	rl_complete_with_tilde_expansion = 1;
-
 	/* Filter out possible ANSI color escape sequences */
 	prompt_tmp = nmc_filter_out_colors ((const char *) rl_prompt);
 
@@ -9243,7 +9236,6 @@
 		generator_func = _meta_abstract_generator;
 	} else if (g_strcmp0 (rl_prompt, PROMPT_IMPORT_FILE) == 0) {
 		rl_attempted_completion_over = 0;
-		rl_complete_with_tilde_expansion = 1;
 	} else if (g_strcmp0 (rl_prompt, PROMPT_VPN_CONNECTION) == 0) {
 		generator_func = gen_vpn_ids;
 	}
--- NetworkManager-1.18.1/clients/cli/devices.c.old	2019-04-20 19:01:59.000000000 +0000
+++ NetworkManager-1.18.1/clients/cli/devices.c	2019-05-10 06:16:21.432108032 +0000
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <readline/readline.h>
+#include <editline/readline.h>
 
 #include "nm-secret-agent-simple.h"
 #include "nm-client-utils.h"
--- NetworkManager-1.18.1/clients/cli/nmcli.c.old	2019-04-20 19:01:59.000000000 +0000
+++ NetworkManager-1.18.1/clients/cli/nmcli.c	2019-05-10 06:16:29.211257692 +0000
@@ -15,8 +15,7 @@
 #include <unistd.h>
 #include <locale.h>
 #include <glib-unix.h>
-#include <readline/readline.h>
-#include <readline/history.h>
+#include <editline/readline.h>
 
 #include "nm-client-utils.h"