=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-find.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- src/usr.bin/tmux/cmd-find.c 2017/03/13 10:53:32 1.42 +++ src/usr.bin/tmux/cmd-find.c 2017/04/05 10:49:46 1.43 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-find.c,v 1.42 2017/03/13 10:53:32 nicm Exp $ */ +/* $OpenBSD: cmd-find.c,v 1.43 2017/04/05 10:49:46 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -256,9 +256,9 @@ * sessions to those containing that pane (we still use the current * window in the best session). */ - if (fs->item != NULL && fs->item->client->tty.path != NULL) { + if (fs->item != NULL) { RB_FOREACH(wp, window_pane_tree, &all_window_panes) { - if (strcmp(wp->tty, fs->item->client->tty.path) == 0) + if (strcmp(wp->tty, fs->item->client->ttyname) == 0) break; } } else @@ -1248,7 +1248,6 @@ struct client *c; char *copy; size_t size; - const char *path; /* A NULL argument means the current client. */ if (item != NULL && target == NULL) { @@ -1265,20 +1264,20 @@ if (size != 0 && copy[size - 1] == ':') copy[size - 1] = '\0'; - /* Check path of each client. */ + /* Check name and path of each client. */ TAILQ_FOREACH(c, &clients, entry) { - if (c->session == NULL || c->tty.path == NULL) + if (c->session == NULL) continue; - path = c->tty.path; - - /* Try for exact match. */ - if (strcmp(copy, path) == 0) + if (strcmp(copy, c->name) == 0) break; - /* Try without leading /dev. */ - if (strncmp(path, _PATH_DEV, (sizeof _PATH_DEV) - 1) != 0) + if (*c->ttyname == '\0') continue; - if (strcmp(copy, path + (sizeof _PATH_DEV) - 1) == 0) + if (strcmp(copy, c->ttyname) == 0) + break; + if (strncmp(c->ttyname, _PATH_DEV, (sizeof _PATH_DEV) - 1) != 0) + continue; + if (strcmp(copy, c->ttyname + (sizeof _PATH_DEV) - 1) == 0) break; }