summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/names.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-10-05 11:04:40 +0000
committernicm <nicm@openbsd.org>2020-10-05 11:04:40 +0000
commit3fa4d618d5e93619bd8ff09fb34b9c05e9d3dc3c (patch)
tree2655404f5198a48f09ad1bcdb06448f45fb02a97 /usr.bin/tmux/names.c
parentTidy the resize code, merge some common bits and add some comments. From (diff)
downloadwireguard-openbsd-3fa4d618d5e93619bd8ff09fb34b9c05e9d3dc3c.tar.xz
wireguard-openbsd-3fa4d618d5e93619bd8ff09fb34b9c05e9d3dc3c.zip
Trim "s from process names; also fix a default format in man page.
Diffstat (limited to 'usr.bin/tmux/names.c')
-rw-r--r--usr.bin/tmux/names.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/tmux/names.c b/usr.bin/tmux/names.c
index 60b0f314a1d..db826680878 100644
--- a/usr.bin/tmux/names.c
+++ b/usr.bin/tmux/names.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: names.c,v 1.42 2020/05/16 15:01:31 nicm Exp $ */
+/* $OpenBSD: names.c,v 1.43 2020/10/05 11:04:40 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -107,7 +107,7 @@ check_window_name(struct window *w)
char *
default_window_name(struct window *w)
{
- char *cmd, *s;
+ char *cmd, *s;
cmd = cmd_stringify_argv(w->active->argc, w->active->argv);
if (cmd != NULL && *cmd != '\0')
@@ -142,6 +142,10 @@ parse_window_name(const char *in)
char *copy, *name, *ptr;
name = copy = xstrdup(in);
+ if (*name == '"')
+ name++;
+ name[strcspn (name, "\"")] = '\0';
+
if (strncmp(name, "exec ", (sizeof "exec ") - 1) == 0)
name = name + (sizeof "exec ") - 1;