File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
ext/mbstring/libmbfl/mbfl Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -1096,9 +1096,8 @@ mbfl_strcut(
1096
1096
} else {
1097
1097
mbfl_convert_filter * encoder = NULL ;
1098
1098
mbfl_convert_filter * decoder = NULL ;
1099
+ int mode_backup ;
1099
1100
const unsigned char * p , * q , * r ;
1100
- size_t position = 0 ;
1101
- unsigned char illegal_substchar ;
1102
1101
struct {
1103
1102
mbfl_convert_filter encoder ;
1104
1103
mbfl_convert_filter decoder ;
@@ -1114,6 +1113,8 @@ mbfl_strcut(
1114
1113
return NULL ;
1115
1114
}
1116
1115
1116
+ mode_backup = decoder -> illegal_mode ;
1117
+
1117
1118
/* wchar filter */
1118
1119
if (!(encoder = mbfl_convert_filter_new (
1119
1120
string -> encoding ,
@@ -1278,19 +1279,9 @@ mbfl_strcut(
1278
1279
bk = _bk ;
1279
1280
}
1280
1281
1281
- position = device . pos ;
1282
+ decoder -> illegal_mode = MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE ;
1282
1283
(* encoder -> filter_flush )(encoder );
1283
-
1284
- if ((encoder -> status && ((encoder -> status & 0xF ) || (encoder -> status == 0x11 ))) || encoder -> cache ) {
1285
- illegal_substchar = (unsigned char ) encoder -> illegal_substchar ;
1286
- while (device .pos > position ) {
1287
- /* check illegal output */
1288
- if (device .buffer [position ++ ] == illegal_substchar ) {
1289
- device .pos = position - 1 ;
1290
- break ;
1291
- }
1292
- }
1293
- }
1284
+ decoder -> illegal_mode = mode_backup ;
1294
1285
1295
1286
if (bk .decoder .filter_dtor )
1296
1287
bk .decoder .filter_dtor (& bk .decoder );
You can’t perform that action at this time.
0 commit comments