mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Remove an unnecessary function.
This commit is contained in:
		
							
								
								
									
										34
									
								
								cmd.c
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								cmd.c
									
									
									
									
									
								
							@@ -208,7 +208,6 @@ const struct cmd_entry *cmd_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void	cmd_clear_state(struct cmd_state *);
 | 
					static void	cmd_clear_state(struct cmd_state *);
 | 
				
			||||||
static struct client	*cmd_get_state_client(struct cmd_q *, int);
 | 
					 | 
				
			||||||
static int	cmd_set_state_flag(struct cmd *, struct cmd_q *, char);
 | 
					static int	cmd_set_state_flag(struct cmd *, struct cmd_q *, char);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
@@ -408,24 +407,6 @@ cmd_clear_state(struct cmd_state *state)
 | 
				
			|||||||
	state->sflag.idx = -1;
 | 
						state->sflag.idx = -1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct client *
 | 
					 | 
				
			||||||
cmd_get_state_client(struct cmd_q *cmdq, int quiet)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	struct cmd	*cmd = cmdq->cmd;
 | 
					 | 
				
			||||||
	struct args	*args = cmd->args;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	switch (cmd->entry->flags & (CMD_CLIENT_C|CMD_CLIENT_T)) {
 | 
					 | 
				
			||||||
	case 0:
 | 
					 | 
				
			||||||
		return (cmd_find_client(cmdq, NULL, 1));
 | 
					 | 
				
			||||||
	case CMD_CLIENT_C:
 | 
					 | 
				
			||||||
		return (cmd_find_client(cmdq, args_get(args, 'c'), quiet));
 | 
					 | 
				
			||||||
	case CMD_CLIENT_T:
 | 
					 | 
				
			||||||
		return (cmd_find_client(cmdq, args_get(args, 't'), quiet));
 | 
					 | 
				
			||||||
	default:
 | 
					 | 
				
			||||||
		fatalx("both -t and -c for %s", cmd->entry->name);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static int
 | 
					static int
 | 
				
			||||||
cmd_set_state_flag(struct cmd *cmd, struct cmd_q *cmdq, char c)
 | 
					cmd_set_state_flag(struct cmd *cmd, struct cmd_q *cmdq, char c)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -603,7 +584,6 @@ cmd_prepare_state(struct cmd *cmd, struct cmd_q *cmdq)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	struct cmd_state	*state = &cmdq->state;
 | 
						struct cmd_state	*state = &cmdq->state;
 | 
				
			||||||
	struct args		*args = cmd->args;
 | 
						struct args		*args = cmd->args;
 | 
				
			||||||
	const char		*cflag, *tflag;
 | 
					 | 
				
			||||||
	char			*tmp;
 | 
						char			*tmp;
 | 
				
			||||||
	int			 error;
 | 
						int			 error;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -621,23 +601,15 @@ cmd_prepare_state(struct cmd *cmd, struct cmd_q *cmdq)
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	switch (cmd->entry->flags & (CMD_CLIENT_C|CMD_CLIENT_T)) {
 | 
						switch (cmd->entry->flags & (CMD_CLIENT_C|CMD_CLIENT_T)) {
 | 
				
			||||||
	case 0:
 | 
						case 0:
 | 
				
			||||||
		state->c = cmd_get_state_client(cmdq, 1);
 | 
							state->c = cmd_find_client(cmdq, NULL, 1);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case CMD_CLIENT_C:
 | 
						case CMD_CLIENT_C:
 | 
				
			||||||
		cflag = args_get(args, 'c');
 | 
							state->c = cmd_find_client(cmdq, args_get(args, 'c'), 0);
 | 
				
			||||||
		if (cflag == NULL)
 | 
					 | 
				
			||||||
			state->c = cmd_get_state_client(cmdq, 0);
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			state->c = cmd_find_client(cmdq, cflag, 0);
 | 
					 | 
				
			||||||
		if (state->c == NULL)
 | 
							if (state->c == NULL)
 | 
				
			||||||
			return (-1);
 | 
								return (-1);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case CMD_CLIENT_T:
 | 
						case CMD_CLIENT_T:
 | 
				
			||||||
		tflag = args_get(args, 't');
 | 
							state->c = cmd_find_client(cmdq, args_get(args, 't'), 0);
 | 
				
			||||||
		if (tflag == NULL)
 | 
					 | 
				
			||||||
			state->c = cmd_get_state_client(cmdq, 0);
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			state->c = cmd_find_client(cmdq, tflag, 0);
 | 
					 | 
				
			||||||
		if (state->c == NULL)
 | 
							if (state->c == NULL)
 | 
				
			||||||
			return (-1);
 | 
								return (-1);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user