diff options
author | 2013-03-25 15:59:57 +0000 | |
---|---|---|
committer | 2013-03-25 15:59:57 +0000 | |
commit | 66fd485847c7edc5040f4db07b77bcc52bfbaab7 (patch) | |
tree | 60f67f4538fc7c1e7cd18e1925338bce78b5f8a4 /usr.bin/tmux/names.c | |
parent | reseed the random pool with 'dmesg' when more devices are attached (diff) | |
download | wireguard-openbsd-66fd485847c7edc5040f4db07b77bcc52bfbaab7.tar.xz wireguard-openbsd-66fd485847c7edc5040f4db07b77bcc52bfbaab7.zip |
Revert the command-prefix change which breaks sequences of commands.
Diffstat (limited to 'usr.bin/tmux/names.c')
-rw-r--r-- | usr.bin/tmux/names.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/usr.bin/tmux/names.c b/usr.bin/tmux/names.c index 53df39cb4d9..73e4c8b8660 100644 --- a/usr.bin/tmux/names.c +++ b/usr.bin/tmux/names.c @@ -1,4 +1,4 @@ -/* $OpenBSD: names.c,v 1.20 2013/03/24 09:21:27 nicm Exp $ */ +/* $OpenBSD: names.c,v 1.21 2013/03/25 15:59:57 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -26,8 +26,8 @@ #include "tmux.h" -void window_name_callback(int, short, void *); -char *parse_window_name(struct window *, const char *); +void window_name_callback(unused int, unused short, void *); +char *parse_window_name(const char *); void queue_window_name(struct window *w) @@ -73,9 +73,9 @@ window_name_callback(unused int fd, unused short events, void *data) */ if (w->active->cmd != NULL && *w->active->cmd == '\0' && name != NULL && name[0] == '-' && name[1] != '\0') - wname = parse_window_name(w, name + 1); + wname = parse_window_name(name + 1); else - wname = parse_window_name(w, name); + wname = parse_window_name(name); free(name); } @@ -98,22 +98,18 @@ default_window_name(struct window *w) if (w->active->screen != &w->active->base) return (xstrdup("[tmux]")); if (w->active->cmd != NULL && *w->active->cmd != '\0') - return (parse_window_name(w, w->active->cmd)); - return (parse_window_name(w, w->active->shell)); + return (parse_window_name(w->active->cmd)); + return (parse_window_name(w->active->shell)); } char * -parse_window_name(struct window *w, const char *in) +parse_window_name(const char *in) { - char *copy, *name, *ptr, *prefix; - size_t prefixlen; - - prefix = options_get_string(&w->options, "command-prefix"); - prefixlen = strlen(prefix); + char *copy, *name, *ptr; name = copy = xstrdup(in); - if (strncmp(name, prefix, prefixlen) == 0) - name = name + prefixlen; + if (strncmp(name, "exec ", (sizeof "exec ") - 1) == 0) + name = name + (sizeof "exec ") - 1; while (*name == ' ') name++; |