version 1.42, 2017/03/13 10:53:32 |
version 1.43, 2017/04/05 10:49:46 |
|
|
* sessions to those containing that pane (we still use the current |
* sessions to those containing that pane (we still use the current |
* window in the best session). |
* 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) { |
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; |
break; |
} |
} |
} else |
} else |
|
|
struct client *c; |
struct client *c; |
char *copy; |
char *copy; |
size_t size; |
size_t size; |
const char *path; |
|
|
|
/* A NULL argument means the current client. */ |
/* A NULL argument means the current client. */ |
if (item != NULL && target == NULL) { |
if (item != NULL && target == NULL) { |
|
|
if (size != 0 && copy[size - 1] == ':') |
if (size != 0 && copy[size - 1] == ':') |
copy[size - 1] = '\0'; |
copy[size - 1] = '\0'; |
|
|
/* Check path of each client. */ |
/* Check name and path of each client. */ |
TAILQ_FOREACH(c, &clients, entry) { |
TAILQ_FOREACH(c, &clients, entry) { |
if (c->session == NULL || c->tty.path == NULL) |
if (c->session == NULL) |
continue; |
continue; |
path = c->tty.path; |
if (strcmp(copy, c->name) == 0) |
|
|
/* Try for exact match. */ |
|
if (strcmp(copy, path) == 0) |
|
break; |
break; |
|
|
/* Try without leading /dev. */ |
if (*c->ttyname == '\0') |
if (strncmp(path, _PATH_DEV, (sizeof _PATH_DEV) - 1) != 0) |
|
continue; |
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; |
break; |
} |
} |
|
|