mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	options_array_item_value cannot return NULL.
This commit is contained in:
		
							
								
								
									
										4
									
								
								cmd.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								cmd.c
									
									
									
									
									
								
							@@ -335,10 +335,6 @@ cmd_try_alias(int *argc, char ***argv)
 | 
				
			|||||||
	a = options_array_first(o);
 | 
						a = options_array_first(o);
 | 
				
			||||||
	while (a != NULL) {
 | 
						while (a != NULL) {
 | 
				
			||||||
		ov = options_array_item_value(a);
 | 
							ov = options_array_item_value(a);
 | 
				
			||||||
		if (ov == NULL) {
 | 
					 | 
				
			||||||
			a = options_array_next(a);
 | 
					 | 
				
			||||||
			continue;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		cp = strchr(ov->string, '=');
 | 
							cp = strchr(ov->string, '=');
 | 
				
			||||||
		if (cp != NULL &&
 | 
							if (cp != NULL &&
 | 
				
			||||||
		    (size_t)(cp - ov->string) == wanted &&
 | 
							    (size_t)(cp - ov->string) == wanted &&
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -185,10 +185,6 @@ environ_update(struct options *oo, struct environ *src, struct environ *dst)
 | 
				
			|||||||
	a = options_array_first(o);
 | 
						a = options_array_first(o);
 | 
				
			||||||
	while (a != NULL) {
 | 
						while (a != NULL) {
 | 
				
			||||||
		ov = options_array_item_value(a);
 | 
							ov = options_array_item_value(a);
 | 
				
			||||||
		if (ov == NULL) {
 | 
					 | 
				
			||||||
			a = options_array_next(a);
 | 
					 | 
				
			||||||
			continue;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if ((envent = environ_find(src, ov->string)) == NULL)
 | 
							if ((envent = environ_find(src, ov->string)) == NULL)
 | 
				
			||||||
			environ_clear(dst, ov->string);
 | 
								environ_clear(dst, ov->string);
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								status.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								status.c
									
									
									
									
									
								
							@@ -1293,7 +1293,6 @@ status_prompt_complete_list(u_int *size, const char *s)
 | 
				
			|||||||
	size_t					  slen = strlen(s), valuelen;
 | 
						size_t					  slen = strlen(s), valuelen;
 | 
				
			||||||
	struct options_entry			 *o;
 | 
						struct options_entry			 *o;
 | 
				
			||||||
	struct options_array_item		 *a;
 | 
						struct options_array_item		 *a;
 | 
				
			||||||
	union options_value			 *ov;
 | 
					 | 
				
			||||||
	const char				 *layouts[] = {
 | 
						const char				 *layouts[] = {
 | 
				
			||||||
		"even-horizontal", "even-vertical", "main-horizontal",
 | 
							"even-horizontal", "even-vertical", "main-horizontal",
 | 
				
			||||||
		"main-vertical", "tiled", NULL
 | 
							"main-vertical", "tiled", NULL
 | 
				
			||||||
@@ -1322,11 +1321,7 @@ status_prompt_complete_list(u_int *size, const char *s)
 | 
				
			|||||||
	if (o != NULL) {
 | 
						if (o != NULL) {
 | 
				
			||||||
		a = options_array_first(o);
 | 
							a = options_array_first(o);
 | 
				
			||||||
		while (a != NULL) {
 | 
							while (a != NULL) {
 | 
				
			||||||
			ov = options_array_item_value(a);
 | 
								value = options_array_item_value(a)->string;
 | 
				
			||||||
			if (ov == NULL)
 | 
					 | 
				
			||||||
				goto next;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			value = ov->string;
 | 
					 | 
				
			||||||
			if ((cp = strchr(value, '=')) == NULL)
 | 
								if ((cp = strchr(value, '=')) == NULL)
 | 
				
			||||||
			    goto next;
 | 
								    goto next;
 | 
				
			||||||
			valuelen = cp - value;
 | 
								valuelen = cp - value;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -429,8 +429,7 @@ tty_keys_build(struct tty *tty)
 | 
				
			|||||||
		a = options_array_first(o);
 | 
							a = options_array_first(o);
 | 
				
			||||||
		while (a != NULL) {
 | 
							while (a != NULL) {
 | 
				
			||||||
			ov = options_array_item_value(a);
 | 
								ov = options_array_item_value(a);
 | 
				
			||||||
			if (ov != NULL)
 | 
								tty_keys_add(tty, ov->string, KEYC_USER + i);
 | 
				
			||||||
				tty_keys_add(tty, ov->string, KEYC_USER + i);
 | 
					 | 
				
			||||||
			a = options_array_next(a);
 | 
								a = options_array_next(a);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -496,8 +496,7 @@ tty_term_find(char *name, int fd, char **cause)
 | 
				
			|||||||
	a = options_array_first(o);
 | 
						a = options_array_first(o);
 | 
				
			||||||
	while (a != NULL) {
 | 
						while (a != NULL) {
 | 
				
			||||||
		ov = options_array_item_value(a);
 | 
							ov = options_array_item_value(a);
 | 
				
			||||||
		if (ov != NULL)
 | 
							tty_term_override(term, ov->string);
 | 
				
			||||||
			tty_term_override(term, ov->string);
 | 
					 | 
				
			||||||
		a = options_array_next(a);
 | 
							a = options_array_next(a);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user