shithub: tinygl

Download patch

ref: 9163e4a8c82e02a3401b6a52d64c141b36c343b4
parent: 33cc6572582f25b2b284f17f2562095ef9f4cb05
author: gek169 <gek169>
date: Wed May 12 17:01:53 EDT 2021

Automatic commit.

--- a/include-demo/stringutil.h
+++ b/include-demo/stringutil.h
@@ -380,7 +380,7 @@
 
 /*Make Child*/
 static strll* consume_until(strll* current_node, const char* find_me, const char delete_findable){
-	long loc;
+	long loc; strll* right_old;
 	loc = strfind(current_node->text, find_me);
 	if(loc < 0){ /*Nothing to do!*/
 		return current_node;
@@ -387,7 +387,9 @@
 	}
 	/*loc was not -1.*/
 	current_node->child = STRUTIL_CALLOC(1, sizeof(strll));
+	right_old = current_node->right;
 	current_node->right = STRUTIL_CALLOC(1, sizeof(strll));
+	current_node->right->right = right_old;
 	current_node->child->text = str_null_terminated_alloc(current_node->text,loc + (delete_findable?strlen(find_me):0));
 	current_node->right->text = strcatalloc(current_node->text + loc + strlen(find_me),"");
 	STRUTIL_FREE(current_node->text);