--- a/mcabber/mcabber/screen.c Sun Mar 27 12:45:41 2011 +0200
+++ b/mcabber/mcabber/screen.c Sun Mar 27 13:35:08 2011 +0200
@@ -3206,7 +3206,7 @@
// scr_cmdhisto_addline()
// Add a line to the inputLine history
-static inline void scr_cmdhisto_addline(char *line)
+static void scr_cmdhisto_addline(char *line)
{
int max_histo_lines;
@@ -3231,6 +3231,19 @@
cmdhisto_nblines++;
}
+// scr_cmdhisto_reset()
+// Reset the inputLine history
+static void scr_cmdhisto_reset(void)
+{
+ while (cmdhisto_nblines) {
+ g_free(cmdhisto->data);
+ cmdhisto = g_list_delete_link(cmdhisto, cmdhisto);
+ cmdhisto_nblines--;
+ }
+ cmdhisto_backup[0] = 0;
+ cmdhisto_cur = NULL;
+}
+
// scr_cmdhisto_prev()
// Look for previous line beginning w/ the given mask in the inputLine history
// Returns NULL if none found
@@ -3496,6 +3509,13 @@
return 0;
}
+// readline_clear_history()
+// Clear command line history.
+void readline_clear_history(void)
+{
+ scr_cmdhisto_reset();
+}
+
void readline_cancel_completion(void)
{
scr_cancel_current_completion();