Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PCRE support #1143

Merged
merged 1 commit into from
Oct 4, 2021
Merged

Add PCRE support #1143

merged 1 commit into from
Oct 4, 2021

Conversation

koutcher
Copy link
Collaborator

@koutcher koutcher commented Sep 9, 2021

Closes #1137

Copy link
Owner

@jonas jonas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

view->regex = calloc(1, sizeof(*view->regex));
if (!view->regex)
return ERROR_OUT_OF_MEMORY;
}

if (*view->grep) {
regfree(view->regex);
*view->grep = 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is more readable to decouple the allocation from regular housekeeping needed when performing a new search.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and also, maybe I should have mentioned it, PCRE has a slight tendency to segfault when using regfree() on view->regex before regcomp().

@koutcher koutcher merged commit 6f609b1 into jonas:master Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for pcre2 search pattern?
2 participants