diff options
author | nicm <nicm> | 2015-04-21 22:42:27 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-04-21 22:42:27 +0000 |
commit | 3909aff06aa6de748ae057cab1e723eec2387edd (patch) | |
tree | 6524459e91c9606c07a83111dd627a0f9a3006e0 | |
parent | 69f292a90e2fb9d48a77a9753127da13554715de (diff) | |
download | rtmux-3909aff06aa6de748ae057cab1e723eec2387edd.tar.gz rtmux-3909aff06aa6de748ae057cab1e723eec2387edd.tar.bz2 rtmux-3909aff06aa6de748ae057cab1e723eec2387edd.zip |
Look up indexes as number before name, makes more sense if windows are
named starting with numbers. From Thomas Adam.
-rw-r--r-- | cmd.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -781,15 +781,15 @@ cmd_lookup_index(struct session *s, const char *name, int *ambiguous) const char *errstr; u_int idx; + idx = strtonum(name, 0, INT_MAX, &errstr); + if (errstr == NULL) + return (idx); + if ((wl = cmd_lookup_window(s, name, ambiguous)) != NULL) return (wl->idx); if (*ambiguous) return (-1); - idx = strtonum(name, 0, INT_MAX, &errstr); - if (errstr == NULL) - return (idx); - return (-1); } |