|  | @@ -304,6 +304,9 @@ static cJSON *cJSONUtils_SortList(cJSON *list)
 | 
											
												
													
														|  |  	cJSON *first=list,*second=list,*ptr=list;
 |  |  	cJSON *first=list,*second=list,*ptr=list;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  	if (!list || !list->next) return list;	/* One entry is sorted already. */
 |  |  	if (!list || !list->next) return list;	/* One entry is sorted already. */
 | 
											
												
													
														|  | 
 |  | +	
 | 
											
												
													
														|  | 
 |  | +	while (ptr && ptr->next && cJSONUtils_strcasecmp(ptr->string,ptr->next->string)<0) ptr=ptr->next;	/* Test for list sorted. */
 | 
											
												
													
														|  | 
 |  | +	if (!ptr || !ptr->next) return list;	/* Leave sorted lists unmodified. */
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  	while (ptr) {second=second->next;ptr=ptr->next;if (ptr) ptr=ptr->next;}	/* Walk two pointers to find the middle. */
 |  |  	while (ptr) {second=second->next;ptr=ptr->next;if (ptr) ptr=ptr->next;}	/* Walk two pointers to find the middle. */
 | 
											
												
													
														|  |  	if (second && second->prev) second->prev->next=0;	/* Split the lists */
 |  |  	if (second && second->prev) second->prev->next=0;	/* Split the lists */
 |