mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 01:48:47 +00:00
Do not allow duplicate session names to be created, reported by Dominik
Honnef, patch from Thomas Adam.
This commit is contained in:
parent
ae70071494
commit
828f12b748
@ -45,6 +45,11 @@ cmd_rename_session_exec(struct cmd *self, struct cmd_ctx *ctx)
|
|||||||
struct cmd_target_data *data = self->data;
|
struct cmd_target_data *data = self->data;
|
||||||
struct session *s;
|
struct session *s;
|
||||||
|
|
||||||
|
if (data->arg != NULL && session_find(data->arg) != NULL) {
|
||||||
|
ctx->error(ctx, "duplicate session: %s", data->arg);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
if ((s = cmd_find_session(ctx, data->target)) == NULL)
|
if ((s = cmd_find_session(ctx, data->target)) == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user