mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last
time now I've configured emacs to make them displayed in really annoying colours...
This commit is contained in:
22
cmd.c
22
cmd.c
@ -169,7 +169,7 @@ cmd_free_argv(int argc, char **argv)
|
||||
int i;
|
||||
|
||||
if (argc == 0)
|
||||
return;
|
||||
return;
|
||||
for (i = 0; i < argc; i++) {
|
||||
if (argv[i] != NULL)
|
||||
xfree(argv[i]);
|
||||
@ -510,7 +510,7 @@ cmd_lookup_session(const char *name, int *ambiguous)
|
||||
* be unique so an exact match can't be ambigious and can just be
|
||||
* returned.
|
||||
*/
|
||||
for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
|
||||
for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
|
||||
if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
|
||||
continue;
|
||||
if (strcmp(name, s->name) == 0)
|
||||
@ -522,7 +522,7 @@ cmd_lookup_session(const char *name, int *ambiguous)
|
||||
* be ambiguous.
|
||||
*/
|
||||
sfound = NULL;
|
||||
for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
|
||||
for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
|
||||
if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
|
||||
continue;
|
||||
if (strncmp(name, s->name, strlen(name)) == 0 ||
|
||||
@ -534,7 +534,7 @@ cmd_lookup_session(const char *name, int *ambiguous)
|
||||
sfound = s;
|
||||
}
|
||||
}
|
||||
return (sfound);
|
||||
return (sfound);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -558,7 +558,7 @@ cmd_lookup_window(struct session *s, const char *name, int *ambiguous)
|
||||
if ((wl = winlink_find_by_index(&s->windows, idx)) != NULL)
|
||||
return (wl);
|
||||
}
|
||||
|
||||
|
||||
/* Look for exact matches, error if more than one. */
|
||||
wlfound = NULL;
|
||||
RB_FOREACH(wl, winlinks, &s->windows) {
|
||||
@ -584,7 +584,7 @@ cmd_lookup_window(struct session *s, const char *name, int *ambiguous)
|
||||
}
|
||||
wlfound = wl;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (wlfound != NULL)
|
||||
return (wlfound);
|
||||
|
||||
@ -707,7 +707,7 @@ cmd_find_window(struct cmd_ctx *ctx, const char *arg, struct session **sp)
|
||||
wl = s->curw;
|
||||
else if ((wl = cmd_lookup_window(s, winptr, &ambiguous)) == NULL)
|
||||
goto not_found;
|
||||
|
||||
|
||||
if (sessptr != NULL)
|
||||
xfree(sessptr);
|
||||
return (wl);
|
||||
@ -808,7 +808,7 @@ cmd_find_index(struct cmd_ctx *ctx, const char *arg, struct session **sp)
|
||||
ctx->error(ctx, "invalid index: %s", arg);
|
||||
idx = -2;
|
||||
}
|
||||
|
||||
|
||||
if (sessptr != NULL)
|
||||
xfree(sessptr);
|
||||
return (idx);
|
||||
@ -830,7 +830,7 @@ no_colon:
|
||||
|
||||
no_session:
|
||||
if (ambiguous)
|
||||
ctx->error(ctx, "multiple sessions: %s", arg);
|
||||
ctx->error(ctx, "multiple sessions: %s", arg);
|
||||
else
|
||||
ctx->error(ctx, "session not found: %s", arg);
|
||||
if (sessptr != NULL)
|
||||
@ -918,7 +918,7 @@ no_period:
|
||||
/* Try index in the current session and window. */
|
||||
if ((*wpp = window_pane_at_index(s->curw->window, idx)) == NULL)
|
||||
goto lookup_window;
|
||||
|
||||
|
||||
return (s->curw);
|
||||
|
||||
lookup_window:
|
||||
@ -926,7 +926,7 @@ lookup_window:
|
||||
if ((wl = cmd_find_window(ctx, arg, sp)) != NULL)
|
||||
*wpp = wl->window->active;
|
||||
return (wl);
|
||||
|
||||
|
||||
error:
|
||||
xfree(winptr);
|
||||
return (NULL);
|
||||
|
Reference in New Issue
Block a user