Skip to content

Commit 44b4fb2

Browse files
committed
Fix legacy text conversion filter for CP50220
In my recent commit which replaced the implementation of mb_convert_kana, the commit message noted that mb_convert_kana previously had a bug whereby null bytes would be 'swallowed' and not passed to the output. This was actually the reason.
1 parent 7299096 commit 44b4fb2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/mbstring/libmbfl/filters/mbfilter_cp5022x.c

+3
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,9 @@ static int mbfl_filt_conv_wchar_cp50220(int c, mbfl_convert_filter *filter)
346346
filter->filter_function = mbfl_filt_conv_wchar_cp50221;
347347
mbfl_filt_conv_wchar_cp50221(s, filter);
348348
filter->filter_function = mbfl_filt_conv_wchar_cp50220;
349+
if (c == 0 && !consumed) {
350+
(*filter->output_function)(0, filter->data);
351+
}
349352
} else if (c == 0) {
350353
/* This case has to be handled separately, since `filter->cache == 0` means
351354
* no codepoint is cached */

0 commit comments

Comments
 (0)