mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Merge branch 'obsd-master' into master
This commit is contained in:
		
							
								
								
									
										14
									
								
								arguments.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								arguments.c
									
									
									
									
									
								
							| @@ -63,6 +63,17 @@ args_find(struct args *args, u_char flag) | ||||
| 	return (RB_FIND(args_tree, &args->tree, &entry)); | ||||
| } | ||||
|  | ||||
| /* Create an empty arguments set. */ | ||||
| struct args * | ||||
| args_create(void) | ||||
| { | ||||
| 	struct args	 *args; | ||||
|  | ||||
| 	args = xcalloc(1, sizeof *args); | ||||
| 	RB_INIT(&args->tree); | ||||
| 	return (args); | ||||
| } | ||||
|  | ||||
| /* Parse an argv and argc into a new argument set. */ | ||||
| struct args * | ||||
| args_parse(const char *template, int argc, char **argv) | ||||
| @@ -70,12 +81,11 @@ args_parse(const char *template, int argc, char **argv) | ||||
| 	struct args	*args; | ||||
| 	int		 opt; | ||||
|  | ||||
| 	args = xcalloc(1, sizeof *args); | ||||
|  | ||||
| 	optreset = 1; | ||||
| 	optind = 1; | ||||
| 	optarg = NULL; | ||||
|  | ||||
| 	args = args_create(); | ||||
| 	while ((opt = getopt(argc, argv, template)) != -1) { | ||||
| 		if (opt < 0) | ||||
| 			continue; | ||||
|   | ||||
| @@ -48,7 +48,7 @@ cmd_find_window_exec(struct cmd *self, struct cmdq_item *item) | ||||
| 	struct cmd_find_state	*target = cmdq_get_target(item); | ||||
| 	struct window_pane	*wp = target->wp; | ||||
| 	const char		*s = args->argv[0], *suffix = ""; | ||||
| 	char			*filter, *argv = { NULL }; | ||||
| 	char			*filter; | ||||
| 	int			 C, N, T; | ||||
|  | ||||
| 	C = args_has(args, 'C'); | ||||
| @@ -91,7 +91,7 @@ cmd_find_window_exec(struct cmd *self, struct cmdq_item *item) | ||||
| 	else | ||||
| 		xasprintf(&filter, "#{m%s:*%s*,#{pane_title}}", suffix, s); | ||||
|  | ||||
| 	new_args = args_parse("", 1, &argv); | ||||
| 	new_args = args_create(); | ||||
| 	if (args_has(args, 'Z')) | ||||
| 		args_set(new_args, 'Z', NULL); | ||||
| 	args_set(new_args, 'f', filter); | ||||
|   | ||||
| @@ -243,7 +243,6 @@ cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item) | ||||
|  | ||||
| 	tmpsize = 256; | ||||
| 	tmp = xmalloc(tmpsize); | ||||
|  | ||||
| 	table = key_bindings_first_table(); | ||||
| 	while (table != NULL) { | ||||
| 		if (tablename != NULL && strcmp(table->name, tablename) != 0) { | ||||
|   | ||||
							
								
								
									
										3
									
								
								format.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								format.c
									
									
									
									
									
								
							| @@ -4078,8 +4078,7 @@ format_replace(struct format_expand_state *es, const char *key, size_t keylen, | ||||
| 			case 's': | ||||
| 				if (fm->argc < 2) | ||||
| 					break; | ||||
| 				sub = xreallocarray (sub, nsub + 1, | ||||
| 				    sizeof *sub); | ||||
| 				sub = xreallocarray(sub, nsub + 1, sizeof *sub); | ||||
| 				sub[nsub++] = fm; | ||||
| 				break; | ||||
| 			case '=': | ||||
|   | ||||
							
								
								
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							| @@ -2183,6 +2183,7 @@ int		tty_keys_next(struct tty *); | ||||
|  | ||||
| /* arguments.c */ | ||||
| void		 args_set(struct args *, u_char, const char *); | ||||
| struct args 	*args_create(void); | ||||
| struct args	*args_parse(const char *, int, char **); | ||||
| void		 args_free(struct args *); | ||||
| char		*args_print(struct args *); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Thomas Adam
					Thomas Adam