--- 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"