-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add patchfile for expansion memory leak
- Loading branch information
1 parent
f8a5c05
commit de50798
Showing
2 changed files
with
23 additions
and
1 deletion.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/src/transliterate.c b/src/transliterate.c | ||
index 7f5fff7..83e502b 100644 | ||
--- a/src/transliterate.c | ||
+++ b/src/transliterate.c | ||
@@ -938,7 +938,9 @@ char *transliterate(char *trans_name, char *str, size_t len) { | ||
if (context_no_match && !prev_state.empty_transition && prev_state.phrase_len > 0) { | ||
log_debug("Previous phrase stays as is %.*s\n", (int)prev_state.phrase_len, str+prev_state.phrase_start); | ||
char_array_cat_len(new_str, str + prev_state.phrase_start, prev_state.phrase_len); | ||
- state = start_state; | ||
+ if (match_candidate_state.state != TRANS_STATE_PARTIAL_MATCH) { | ||
+ state = start_state; | ||
+ } | ||
} | ||
|
||
if (state.state == TRANS_STATE_BEGIN && !prev_state.empty_transition) { |