summaryrefslogtreecommitdiff
path: root/user/networkmanager/editline.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/networkmanager/editline.patch')
-rw-r--r--user/networkmanager/editline.patch128
1 files changed, 128 insertions, 0 deletions
diff --git a/user/networkmanager/editline.patch b/user/networkmanager/editline.patch
new file mode 100644
index 000000000..e97461d3a
--- /dev/null
+++ b/user/networkmanager/editline.patch
@@ -0,0 +1,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
+@@ -25,8 +25,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
+@@ -26,8 +26,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"
+@@ -984,7 +983,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,
+@@ -995,8 +994,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);
+@@ -1006,8 +1004,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;
+ }
+
+@@ -1016,7 +1013,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
+@@ -26,8 +26,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"
+@@ -6007,9 +6006,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
+@@ -6036,9 +6032,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);
+
+@@ -9142,7 +9135,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
+@@ -23,7 +23,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
+@@ -30,8 +30,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"
+