diff options
author | 2014-01-22 14:00:08 +0000 | |
---|---|---|
committer | 2014-01-22 14:00:08 +0000 | |
commit | 29a8fcab15ef423cb231a813376371748835fc20 (patch) | |
tree | f60d937808a6e5596026ee5c9f427a8ecd16c915 /usr.bin/tmux/session.c | |
parent | Only exit copy mode at the bottom if no selection in progress, from (diff) | |
download | wireguard-openbsd-29a8fcab15ef423cb231a813376371748835fc20.tar.xz wireguard-openbsd-29a8fcab15ef423cb231a813376371748835fc20.zip |
Do not permit periods in session names (colons are already banned). From
J Raynor.
Diffstat (limited to 'usr.bin/tmux/session.c')
-rw-r--r-- | usr.bin/tmux/session.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c index 6cf124b3ed4..ec8996ecf91 100644 --- a/usr.bin/tmux/session.c +++ b/usr.bin/tmux/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.41 2013/10/10 12:26:36 nicm Exp $ */ +/* $OpenBSD: session.c,v 1.42 2014/01/22 14:00:08 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -175,11 +175,11 @@ session_destroy(struct session *s) RB_INSERT(sessions, &dead_sessions, s); } -/* Check a session name is valid: not empty and no colons. */ +/* Check a session name is valid: not empty and no colons or periods. */ int session_check_name(const char *name) { - return (*name != '\0' && strchr(name, ':') == NULL); + return (*name != '\0' && name[strcspn(name, ":.")] == '\0'); } /* Update session active time. */ |