Description: Fix "Segmentation fault" after entering any command.
Author: Anton Gladky <gladky.anton@gmail.com>
Bug-Debian: http://bugs.debian.org/665832
Bug-Debian: http://bugs.debian.org/665432
Last-Update: 2012-03-30

--- a/src/command.c
+++ b/src/command.c
@@ -2688,9 +2688,14 @@
 #  elif defined(HAVE_LIBEDITLINE)
 	    /* deleting history entries does not work, so suppress adjacent 
 	    duplicates only */
-	    while (previous_history());
-	    if (strcmp(current_history()->line, line) != 0)
-		add_history(line);
+      
+	    int found;
+	    using_history();
+
+	    found = history_search(line, -1);
+	    if (found <= 0) {
+               add_history(line);
+            }
 #  else /* builtin readline */
 	    add_history(line);
 #  endif
