diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2011-04-06 21:51:31 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2011-04-06 21:51:31 +0000 |
commit | ec89eb955236f91e63febe1764123e605641fc52 (patch) | |
tree | c81e8a37c4625857f084ffdf70efba82fe715df3 /cmd-rename-session.c | |
parent | c8a14def9f2273c13d081c891d76e5f32323fc40 (diff) | |
download | rtmux-ec89eb955236f91e63febe1764123e605641fc52.tar.gz rtmux-ec89eb955236f91e63febe1764123e605641fc52.tar.bz2 rtmux-ec89eb955236f91e63febe1764123e605641fc52.zip |
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 'cmd-rename-session.c')
-rw-r--r-- | cmd-rename-session.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd-rename-session.c b/cmd-rename-session.c index 018e537f..cbda700f 100644 --- a/cmd-rename-session.c +++ b/cmd-rename-session.c @@ -46,6 +46,10 @@ cmd_rename_session_exec(struct cmd *self, struct cmd_ctx *ctx) const char *newname; newname = args->argv[0]; + if (!session_check_name(newname)) { + ctx->error(ctx, "bad session name: %s", newname); + return (-1); + } if (session_find(newname) != NULL) { ctx->error(ctx, "duplicate session: %s", newname); return (-1); |