aboutsummaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2011-04-06 22:29:26 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2011-04-06 22:29:26 +0000
commite5f4bf3f3ec206bedf0f4a04b8158cff8c734f11 (patch)
treebc143973bb375f5176d41a00384d7cab9bbb944d /session.c
parent13c54a04a0ef236dd2df36ca3fa5fd1b89272be6 (diff)
downloadrtmux-e5f4bf3f3ec206bedf0f4a04b8158cff8c734f11.tar.gz
rtmux-e5f4bf3f3ec206bedf0f4a04b8158cff8c734f11.tar.bz2
rtmux-e5f4bf3f3ec206bedf0f4a04b8158cff8c734f11.zip
|PatchSet 884
|Date: 2011/04/06 22:51:31 |Author: nicm |Branch: HEAD |Tag: (none) |Log: |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.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/session.c b/session.c
index 3e92d3d6..3eac8c23 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
-/* $Id: session.c,v 1.88 2011-02-15 15:09:52 tcunha Exp $ */
+/* $Id: session.c,v 1.89 2011-04-06 22:29:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -163,6 +163,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)