Fix a few small bugs.
This commit is contained in:
parent
452b6e660e
commit
a2044b596a
|
@ -301,7 +301,7 @@ void regex_node_clear(regex_node* node);
|
||||||
* Frees an entire NFA, starting from the given root node.
|
* Frees an entire NFA, starting from the given root node.
|
||||||
* @param root the root, or starting node, of the NFA.
|
* @param root the root, or starting node, of the NFA.
|
||||||
*/
|
*/
|
||||||
void regex_free(regex_node* root);
|
libregex_result regex_free(regex_node* root);
|
||||||
/**
|
/**
|
||||||
* Builds a regular expression from the given regular expression strings.
|
* Builds a regular expression from the given regular expression strings.
|
||||||
* @param root the root node to build into.
|
* @param root the root node to build into.
|
||||||
|
|
|
@ -78,6 +78,7 @@ libregex_result _regex_node_create_group(regex_node** open, regex_node** close,
|
||||||
} else {
|
} else {
|
||||||
free(*open);
|
free(*open);
|
||||||
free(*close);
|
free(*close);
|
||||||
|
*open = *close = NULL;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -149,7 +150,7 @@ void _regex_chain_append_chain(regex_chain* append_to, regex_chain* to_append){
|
||||||
|
|
||||||
libregex_result _regex_find_all(regex_node* node, ll* append_to, int tag_with){
|
libregex_result _regex_find_all(regex_node* node, ll* append_to, int tag_with){
|
||||||
libregex_result result = LIBREGEX_SUCCESS;
|
libregex_result result = LIBREGEX_SUCCESS;
|
||||||
if(node->list_id != tag_with){
|
if(node && node->list_id != tag_with){
|
||||||
node->list_id = tag_with;
|
node->list_id = tag_with;
|
||||||
if(node->type == REGEX_VALUE){
|
if(node->type == REGEX_VALUE){
|
||||||
result = _regex_find_all(node->data_u.value_s.next, append_to, tag_with);
|
result = _regex_find_all(node->data_u.value_s.next, append_to, tag_with);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user