summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/cmd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c
index 5b9ba25de01..3c7c6c64a6e 100644
--- a/usr.bin/tmux/cmd.c
+++ b/usr.bin/tmux/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.64 2012/04/22 05:24:05 nicm Exp $ */
+/* $OpenBSD: cmd.c,v 1.65 2012/04/23 22:43:09 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1325,8 +1325,10 @@ find_home:
return (s->cwd);
complete_path:
- if (root[skip] == '\0')
- return (root);
+ if (root[skip] == '\0') {
+ strlcpy(path, root, sizeof path);
+ return (path);
+ }
n = snprintf(path, sizeof path, "%s/%s", root, cwd + skip);
if (n > 0 && (size_t)n < sizeof path)
return (path);