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.
This commit is contained in:
Nicholas Marriott
2011-04-06 21:51:31 +00:00
parent c8a14def9f
commit ec89eb9552
5 changed files with 29 additions and 5 deletions

View File

@ -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);