mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 10:47:18 +00:00 
			
		
		
		
	utils: Make behavior of ast_strsep* match strsep.
Given the scenario of passing an empty string to the
ast_strsep functions the functions would return NULL
instead of an empty string. This is counter to how
strsep itself works.
This change alters the behavior of the functions to
match that of strsep.
Fixes: #565
(cherry picked from commit 8ce69eda14)
			
			
This commit is contained in:
		
				
					committed by
					
						 Asterisk Development Team
						Asterisk Development Team
					
				
			
			
				
	
			
			
			
						parent
						
							b510d681a1
						
					
				
				
					commit
					731fddd5d0
				
			| @@ -271,7 +271,7 @@ enum ast_strsep_flags { | ||||
|   AST_STRSEP_UNESCAPE unescapes '\' sequences. | ||||
|   AST_STRSEP_ALL does all of the above processing. | ||||
|   \return The next token or NULL if done or if there are more than 8 levels of | ||||
|   nested quotes. | ||||
|   nested quotes. If provided an empty string, will return the empty string. | ||||
|  | ||||
|   This function acts like strsep with three exceptions... | ||||
|   The separator is a single character instead of a string. | ||||
| @@ -323,7 +323,7 @@ char *ast_strsep(char **s, const char sep, uint32_t flags); | ||||
|   AST_STRSEP_UNESCAPE unescapes '\' sequences. | ||||
|   AST_STRSEP_ALL does all of the above processing. | ||||
|   \return The next token or NULL if done or if there are more than 8 levels of | ||||
|   nested quotes. | ||||
|   nested quotes. If provided an empty string, will return the empty string. | ||||
|  */ | ||||
| char *ast_strsep_quoted(char **s, const char sep, const char quote, uint32_t flags); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user