summaryrefslogtreecommitdiff
path: root/src/fe-text/gui-readline.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-10-14 11:17:13 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-10-14 11:17:13 +0000
commitf86da8c0e5d644a46df07d60e6c30a96f7d5c3fa (patch)
treebf51c04b69920ac65e4518bd0e7b0ad1c98e7904 /src/fe-text/gui-readline.c
parent1718083cf655dd8e3a1f4cf91dd6f2ee064a3b2a (diff)
downloadirssi-f86da8c0e5d644a46df07d60e6c30a96f7d5c3fa.zip
Window-statusbars are created correctly with /RELOAD, some input line
fixes related to /RELOAD. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1831 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/gui-readline.c')
-rw-r--r--src/fe-text/gui-readline.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c
index 4d71e195..84fba1a9 100644
--- a/src/fe-text/gui-readline.c
+++ b/src/fe-text/gui-readline.c
@@ -145,29 +145,29 @@ void handle_key(int key)
static void key_send_line(void)
{
- int add_history;
- char *str;
+ char *str, *add_history;
str = gui_entry_get_text(active_entry);
if (*str == '\0') return;
+ /* we can't use gui_entry_get_text() later, since the entry might
+ have been destroyed after we get back */
+ add_history = g_strdup(str);
translate_output(str);
- add_history = TRUE;
if (redir == NULL) {
signal_emit("send command", 3, str,
active_win->active_server,
active_win->active);
} else {
if (redir->flags & ENTRY_REDIRECT_FLAG_HIDDEN)
- add_history = FALSE;
+ g_free_and_null(add_history);
handle_entry_redirect(str);
}
- if (add_history) {
- command_history_add(active_win, gui_entry_get_text(active_entry),
- FALSE);
- }
+ if (add_history != NULL)
+ command_history_add(active_win, add_history, FALSE);
+
gui_entry_set_text(active_entry, "");
command_history_clear_pos(active_win);
}