diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-08-08 16:05:02 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-08-08 16:05:02 +0000 |
commit | 23a993a7b5abf5fef84b39473385089038f025c8 (patch) | |
tree | 9a5fdc61feb32fe10b06f68dd0b4265f22344e95 /usr.bin | |
parent | 0e42ecc2cd2edfa08ec2ab49fbcab8af4e8a3bf1 (diff) |
Handle ttyname(3) failure better.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/cmd-list-windows.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-list-windows.c b/usr.bin/tmux/cmd-list-windows.c index 4a0c38b6cdb..7c050ca32ca 100644 --- a/usr.bin/tmux/cmd-list-windows.c +++ b/usr.bin/tmux/cmd-list-windows.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-list-windows.c,v 1.5 2009/08/08 13:29:27 nicm Exp $ */ +/* $OpenBSD: cmd-list-windows.c,v 1.6 2009/08/08 16:05:01 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -72,9 +72,10 @@ cmd_list_windows_exec(struct cmd *self, struct cmd_ctx *ctx) } size += gd->hsize * sizeof *gd->linedata; + name = NULL; if (wp->fd != -1) name = ttyname(wp->fd); - else + if (name == NULL) name = "unknown"; ctx->print(ctx, " %s [%ux%u] [history %u/%u, %llu bytes]", |