diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2009-09-05 16:06:16 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2009-09-05 16:06:16 +0000 |
commit | 18d23255062fad5339584ae94114a450d705a036 (patch) | |
tree | ff0abc497f5cbad8c7c4de4594c2e1e42653f08f /app | |
parent | 0bfe30f1f8426d3e7c82459bca752530d6a1e469 (diff) |
re-introduce the intention of the change from rev 1.4 in menu.c here
instead, by moving the check for '\0' to only the places that it
matters. hint and 50% of the diff from oga@, prodded by todd@
ok oga@
Diffstat (limited to 'app')
-rw-r--r-- | app/cwm/kbfunc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index 769491e62..4dfaaf6b3 100644 --- a/app/cwm/kbfunc.c +++ b/app/cwm/kbfunc.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: kbfunc.c,v 1.42 2009/08/25 02:02:59 okan Exp $ + * $Id: kbfunc.c,v 1.43 2009/09/05 16:06:15 okan Exp $ */ #include <paths.h> @@ -285,6 +285,8 @@ kbfunc_exec(struct client_ctx *scratch, union arg *arg) if ((mi = menu_filter(&menuq, label, NULL, 1, search_match_exec, NULL)) != NULL) { + if (mi->text[0] == '\0') + goto out; switch (cmd) { case CWM_EXEC_PROGRAM: u_spawn(mi->text); @@ -298,7 +300,7 @@ kbfunc_exec(struct client_ctx *scratch, union arg *arg) break; } } - +out: if (mi != NULL && mi->dummy) xfree(mi); while ((mi = TAILQ_FIRST(&menuq)) != NULL) { @@ -360,12 +362,14 @@ kbfunc_ssh(struct client_ctx *scratch, union arg *arg) if ((mi = menu_filter(&menuq, "ssh", NULL, 1, search_match_exec, NULL)) != NULL) { + if (mi->text[0] == '\0') + goto out; l = snprintf(cmd, sizeof(cmd), "%s -e ssh %s", Conf.termpath, mi->text); if (l != -1 && l < sizeof(cmd)) u_spawn(cmd); } - +out: if (mi != NULL && mi->dummy) xfree(mi); while ((mi = TAILQ_FIRST(&menuq)) != NULL) { |