mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +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:
		@@ -19,6 +19,7 @@
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#include "tmux.h"
 | 
			
		||||
 | 
			
		||||
@@ -50,6 +51,9 @@ cmd_rename_session_exec(struct cmd *self, struct cmdq_item *item)
 | 
			
		||||
	const char	*newname;
 | 
			
		||||
 | 
			
		||||
	newname = args->argv[0];
 | 
			
		||||
	if (strcmp(newname, s->name) == 0)
 | 
			
		||||
		return (CMD_RETURN_NORMAL);
 | 
			
		||||
 | 
			
		||||
	if (!session_check_name(newname)) {
 | 
			
		||||
		cmdq_error(item, "bad session name: %s", newname);
 | 
			
		||||
		return (CMD_RETURN_ERROR);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user