commit 657e9379807b215593e8c0706a51872b7870e8fe
Author: Laslo Hunhold <[email protected]>
AuthorDate: Sat Oct 8 13:17:47 2022 +0200
Commit: Laslo Hunhold <[email protected]>
CommitDate: Sat Oct 8 13:17:47 2022 +0200
Explicitly pop the reader-limit in to_titlecase()
This ensures that we don't have any stray limits on the stack and
always have a clean state.
Signed-off-by: Laslo Hunhold <[email protected]>
diff --git a/src/case.c b/src/case.c
index 4d289fd..72c1d6b 100644
--- a/src/case.c
+++ b/src/case.c
@@ -185,12 +185,14 @@ to_titlecase(HERODOTUS_READER *r, HERODOTUS_WRITER *w)
if (s == HERODOTUS_STATUS_END_OF_BUFFER) {
/* we are done */
+ herodotus_reader_pop_limit(r);
break;
} else if (s == HERODOTUS_STATUS_SOFT_LIMIT_REACHED) {
/*
* we did not encounter any cased character
* up to the word break
*/
+ herodotus_reader_pop_limit(r);
continue;
} else {
/*