summaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2015-04-22 10:05:54 +0100
committerThomas Adam <thomas@xteddy.org>2015-04-22 10:05:54 +0100
commit0a88377086329786c438d4973365fdb21186f4e4 (patch)
treedf5b091b400df84974f58bbfbb78ee26ccb9a5f6 /cmd.c
parentb25dc423b0b1369aaec5dee8e051d541bd55043f (diff)
parent3909aff06aa6de748ae057cab1e723eec2387edd (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd.c b/cmd.c
index 9e41c1f9..880a1034 100644
--- a/cmd.c
+++ b/cmd.c
@@ -780,15 +780,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);
}