summaryrefslogblamecommitdiff
path: root/user/networkmanager/editline.patch
blob: e727f374a6bc8c5516d57b50b8e440e3e26bac81 (plain) (tree)























                                                                                           
                     







                                                                                                       
                     








                                                     
                     








                                                             
                      






















                                                                                           
                     








                                                                        
                     








                                                                      
                     





























                                                                                           
--- 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"
@@ -1008,7 +1007,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,
@@ -1019,8 +1018,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);
@@ -1030,8 +1028,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;
 	}
 
@@ -1040,7 +1037,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"
@@ -6050,9 +6049,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
@@ -6079,9 +6075,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);
 
@@ -9150,7 +9143,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"