[2744] in BarnOwl Developers
[PATCH] Remove the echochar hack in owl_command_edit_cancel
daemon@ATHENA.MIT.EDU (David Benjamin)
Sun Nov 7 01:01:55 2010
From: David Benjamin <davidben@MIT.EDU>
To: barnowl-dev@mit.edu
Date: Sun, 7 Nov 2010 01:01:43 -0400
owl_function_start_password passes a NULL history, so there
is no need for this. While we're at it, explicitly check for NULL
history in places. While owl_history_* already checks, it's a bit
sketchy.
---
commands.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/commands.c b/commands.c
index 5cbe262..e639cb4 100644
--- a/commands.c
+++ b/commands.c
@@ -2710,8 +2710,8 @@ void owl_command_edit_cancel(owl_editwin *e)
owl_function_makemsg("Command cancelled.");
- if(owl_editwin_get_echochar(e) == 0) {
- hist=owl_editwin_get_history(e);
+ hist = owl_editwin_get_history(e);
+ if (hist) {
owl_history_store(hist, owl_editwin_get_text(e));
owl_history_reset(hist);
}
@@ -2725,6 +2725,8 @@ void owl_command_edit_history_prev(owl_editwin *e)
const char *ptr;
hist=owl_editwin_get_history(e);
+ if (!hist)
+ return;
if (!owl_history_is_touched(hist)) {
owl_history_store(hist, owl_editwin_get_text(e));
owl_history_set_partial(hist);
@@ -2744,6 +2746,8 @@ void owl_command_edit_history_next(owl_editwin *e)
const char *ptr;
hist=owl_editwin_get_history(e);
+ if (!hist)
+ return;
ptr=owl_history_get_next(hist);
if (ptr) {
owl_editwin_clear(e);
--
1.7.3.1.g716de