summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-04-06 21:51:31 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-04-06 21:51:31 +0000
commitec89eb955236f91e63febe1764123e605641fc52 (patch)
treec81e8a37c4625857f084ffdf70efba82fe715df3 /session.c
parentc8a14def9f2273c13d081c891d76e5f32323fc40 (diff)
Change so that an empty session name always means the current sessions
even if given with, for example, -t '', and explicitly forbid empty session names and those containing a : when they are created.
Diffstat (limited to 'session.c')
-rw-r--r--session.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/session.c b/session.c
index 9babd81c..e9bffed2 100644
--- a/session.c
+++ b/session.c
@@ -164,6 +164,13 @@ session_destroy(struct session *s)
RB_INSERT(sessions, &dead_sessions, s);
}
+/* Check a session name is valid: not empty and no colons. */
+int
+session_check_name(const char *name)
+{
+ return (*name != '\0' && strchr(name, ':') == NULL);
+}
+
/* Update session active time. */
void
session_update_activity(struct session *s)