mirror of
https://github.com/tmux/tmux.git
synced 2025-04-01 13:18:49 +00:00
Don't error if renaming a session to its current name, from shik dot
chen at gmail dot com.
This commit is contained in:
parent
81f1d625af
commit
a8e2d851fe
@ -19,6 +19,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "tmux.h"
|
#include "tmux.h"
|
||||||
|
|
||||||
@ -50,6 +51,9 @@ cmd_rename_session_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
const char *newname;
|
const char *newname;
|
||||||
|
|
||||||
newname = args->argv[0];
|
newname = args->argv[0];
|
||||||
|
if (strcmp(newname, s->name) == 0)
|
||||||
|
return (CMD_RETURN_NORMAL);
|
||||||
|
|
||||||
if (!session_check_name(newname)) {
|
if (!session_check_name(newname)) {
|
||||||
cmdq_error(item, "bad session name: %s", newname);
|
cmdq_error(item, "bad session name: %s", newname);
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
|
Loading…
Reference in New Issue
Block a user