diff options
author | 2015-04-28 11:57:20 +0000 | |
---|---|---|
committer | 2015-04-28 11:57:20 +0000 | |
commit | fca01ebf2a6ca225c2877daca217caf28fbac8b7 (patch) | |
tree | d84c03ed1190fc7753e554d2eb38ae1017803767 /usr.bin/tmux/cmd-find.c | |
parent | If can't find pane as a pane, try as a window; likewise if can't find (diff) | |
download | wireguard-openbsd-fca01ebf2a6ca225c2877daca217caf28fbac8b7.tar.xz wireguard-openbsd-fca01ebf2a6ca225c2877daca217caf28fbac8b7.zip |
Do not do a search for the tty path if there isn't one.
Diffstat (limited to 'usr.bin/tmux/cmd-find.c')
-rw-r--r-- | usr.bin/tmux/cmd-find.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/tmux/cmd-find.c b/usr.bin/tmux/cmd-find.c index 976b396f61d..5be7ec6c311 100644 --- a/usr.bin/tmux/cmd-find.c +++ b/usr.bin/tmux/cmd-find.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-find.c,v 1.4 2015/04/28 11:33:17 nicm Exp $ */ +/* $OpenBSD: cmd-find.c,v 1.5 2015/04/28 11:57:20 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@users.sourceforge.net> @@ -243,10 +243,13 @@ cmd_find_current_session_with_client(struct cmd_find_state *fs) struct window_pane *wp; /* If this is running in a pane, that's great. */ - RB_FOREACH(wp, window_pane_tree, &all_window_panes) { - if (strcmp(wp->tty, fs->cmdq->client->tty.path) == 0) - break; - } + if (fs->cmdq->client->tty.path != NULL) { + RB_FOREACH(wp, window_pane_tree, &all_window_panes) { + if (strcmp(wp->tty, fs->cmdq->client->tty.path) == 0) + break; + } + } else + wp = NULL; /* Not running in a pane. We know nothing. Find the best session. */ if (wp == NULL) { |