Fixed delete on no input

This commit is contained in:
James Booth
2012-02-06 22:07:50 +00:00
parent b2173522cd
commit 14f4478bea

View File

@@ -126,11 +126,13 @@ void event_loop(xmpp_ctx_t *ctx, xmpp_conn_t *conn)
// if delete pressed, go back and delete it // if delete pressed, go back and delete it
if (ch == 127) { if (ch == 127) {
if (size > 0) {
getyx(cmd_win, cmd_y, cmd_x); getyx(cmd_win, cmd_y, cmd_x);
wmove(cmd_win, cmd_y, cmd_x-1); wmove(cmd_win, cmd_y, cmd_x-1);
wdelch(cmd_win); wdelch(cmd_win);
size--; size--;
} }
}
// else if not error or newline, show it and store it // else if not error or newline, show it and store it
else if (ch != ERR && ch != '\n') { else if (ch != ERR && ch != '\n') {
waddch(cmd_win, ch); waddch(cmd_win, ch);