diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-19 20:53:04 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-19 20:53:04 +0000 |
commit | 471e37659fb66011f3c163241de041c727863a43 (patch) | |
tree | 49f49f262ba9965ed46cdca20780bb044f2ee750 | |
parent | 6d9eaa64406c7251ceeedf779f63eb8c7b1630eb (diff) | |
download | rtmux-471e37659fb66011f3c163241de041c727863a43.tar.gz rtmux-471e37659fb66011f3c163241de041c727863a43.tar.bz2 rtmux-471e37659fb66011f3c163241de041c727863a43.zip |
Handle empty strings as escape.
-rw-r--r-- | status.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: status.c,v 1.33 2008-06-19 20:48:48 nicm Exp $ */ +/* $Id: status.c,v 1.34 2008-06-19 20:53:04 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -413,9 +413,12 @@ status_prompt_key(struct client *c, int key) } break; case '\r': /* enter */ - c->prompt_callback(c->prompt_data, c->prompt_buffer); - server_clear_client_prompt(c); - break; + if (*c->prompt_buffer != '\0') { + c->prompt_callback(c->prompt_data, c->prompt_buffer); + server_clear_client_prompt(c); + break; + } + /* FALLTHROUGH */ case '\e': /* escape */ c->prompt_callback(c->prompt_data, NULL); server_clear_client_prompt(c); |