packages: asterisk/Fix-history-loading-when-using-external-libedit.patch (N...

zbyniu zbyniu at pld-linux.org
Wed Aug 4 16:55:45 CEST 2010


Author: zbyniu                       Date: Wed Aug  4 14:55:45 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- from fedora

---- Files affected:
packages/asterisk:
   Fix-history-loading-when-using-external-libedit.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/asterisk/Fix-history-loading-when-using-external-libedit.patch
diff -u /dev/null packages/asterisk/Fix-history-loading-when-using-external-libedit.patch:1.1
--- /dev/null	Wed Aug  4 16:55:45 2010
+++ packages/asterisk/Fix-history-loading-when-using-external-libedit.patch	Wed Aug  4 16:55:40 2010
@@ -0,0 +1,49 @@
+From 346965149827844aa5a5f06ab155787e54a70e30 Mon Sep 17 00:00:00 2001
+From: Jeffrey C. Ollie <jeff at ocjtech.us>
+Date: Mon, 8 Mar 2010 12:38:56 -0600
+Subject: [PATCH 2/2] Use the library function for loading command history rather than
+ implementing our own.
+
+---
+ main/asterisk.c |   21 ++-------------------
+ 1 files changed, 2 insertions(+), 19 deletions(-)
+
+diff --git a/main/asterisk.c b/main/asterisk.c
+index e27f685..b8176c5 100644
+--- a/main/asterisk.c
++++ b/main/asterisk.c
+@@ -2567,29 +2567,12 @@ static int ast_el_write_history(char *filename)
+ 
+ static int ast_el_read_history(char *filename)
+ {
+-	char buf[MAX_HISTORY_COMMAND_LENGTH];
+-	FILE *f;
+-	int ret = -1;
++	HistEvent ev;
+ 
+ 	if (el_hist == NULL || el == NULL)
+ 		ast_el_initialize();
+ 
+-	if ((f = fopen(filename, "r")) == NULL)
+-		return ret;
+-
+-	while (!feof(f)) {
+-		if (!fgets(buf, sizeof(buf), f))
+-			break;
+-		if (!strcmp(buf, "_HiStOrY_V2_\n"))
+-			continue;
+-		if (ast_all_zeros(buf))
+-			continue;
+-		if ((ret = ast_el_add_history(buf)) == -1)
+-			break;
+-	}
+-	fclose(f);
+-
+-	return ret;
++	return (history(el_hist, &ev, H_LOAD, filename));
+ }
+ 
+ static void ast_remotecontrol(char *data)
+-- 
+1.6.6.1
+
================================================================


More information about the pld-cvs-commit mailing list