In the case of creating a new window, tmux would end up checking the window name
before the index. This is usually OK, save for the fact that if a window ever
has as its title, the same number as the index, then the check is in error.
Instead, make cmd_lookup_index() check the index and then the title; returning
early if the index matches.
---
cmd.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/cmd.c b/cmd.c
index eeffe4c..ae0e4b1 100644
--- a/cmd.c
+++ b/cmd.c
@@ -711,15 +711,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);
}
--
2.0.1
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-users