mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 18:38:48 +00:00
Do not permit periods in session names (colons are already banned). From
J Raynor.
This commit is contained in:
parent
df680d7257
commit
9ee93b3ea3
@ -175,11 +175,11 @@ session_destroy(struct session *s)
|
|||||||
RB_INSERT(sessions, &dead_sessions, 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
|
int
|
||||||
session_check_name(const char *name)
|
session_check_name(const char *name)
|
||||||
{
|
{
|
||||||
return (*name != '\0' && strchr(name, ':') == NULL);
|
return (*name != '\0' && name[strcspn(name, ":.")] == '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update session active time. */
|
/* Update session active time. */
|
||||||
|
Loading…
Reference in New Issue
Block a user