Move simple_string_list_size() into pgut.c, with the rest of these string functions.
Also, fix an error with this function not actually using its string_list argument.
This commit is contained in:
		
				
					committed by
					
						 Daniele Varrazzo
						Daniele Varrazzo
					
				
			
			
				
	
			
			
			
						parent
						
							40626769d8
						
					
				
				
					commit
					decd822393
				
			| @ -417,6 +417,21 @@ simple_string_list_member(SimpleStringList *list, const char *val) | ||||
| 	return false; | ||||
| } | ||||
|  | ||||
| /* Returns the number of elements in the given SimpleStringList */ | ||||
| size_t | ||||
| simple_string_list_size(SimpleStringList string_list) | ||||
| { | ||||
| 	size_t 					i = 0; | ||||
| 	SimpleStringListCell   *cell = string_list.head; | ||||
|  | ||||
| 	while (cell) | ||||
| 	{ | ||||
| 		cell = cell->next; | ||||
| 		i++; | ||||
| 	} | ||||
|  | ||||
| 	return i; | ||||
| } | ||||
|  | ||||
| static char * | ||||
| prompt_for_password(void) | ||||
|  | ||||
| @ -186,6 +186,7 @@ typedef struct SimpleStringList | ||||
|  | ||||
| extern void simple_string_list_append(SimpleStringList *list, const char *val); | ||||
| extern bool simple_string_list_member(SimpleStringList *list, const char *val); | ||||
| extern size_t simple_string_list_size(SimpleStringList string_list); | ||||
|  | ||||
|  | ||||
| /* | ||||
|  | ||||
		Reference in New Issue
	
	Block a user