-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xdo_search: fix improper memfrees, pre-compile regexes optimization
Original author: Peter Wu <[email protected]> Modified by: Cycatz <[email protected]> If any of compile_re statements fails, all uninitialized regex_t objects are freed due to short-circuit evaluation, which causing segmentation faults. Now they are initialized to zero with memset and besides that, all regexes are now pre-compiled before iterating through all windows. (as a side-effect of the optimization: return early when a regex fails to compile). Other changes: constantify regex_t* where applicable.
- Loading branch information
Showing
1 changed file
with
70 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters