On Mon, Jan 6, 2014 at 9:22 AM, Nicholas Marriott
<nicholas.marri...@gmail.com> wrote:
> Hmm... I don't know, people who include periods in session names are
> probably just asking for trouble but maybe we should ban them earlier.


By "ban them earlier" do you mean never allow periods in session
names?  If so, the attached patch will do that.
diff --git a/session.c b/session.c
index 66a52bc..0730771 100644
--- a/session.c
+++ b/session.c
@@ -174,11 +174,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. */
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to