File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3382,6 +3382,7 @@ mch_print_text_out(char_u *p, int len UNUSED)
33823382#ifdef FEAT_MBYTE
33833383 int in_ascii ;
33843384 int half_width ;
3385+ char_u * tofree = NULL ;
33853386#endif
33863387
33873388 char_width = prt_char_width ;
@@ -3507,27 +3508,22 @@ mch_print_text_out(char_u *p, int len UNUSED)
35073508
35083509#ifdef FEAT_MBYTE
35093510 if (prt_do_conv )
3510- {
35113511 /* Convert from multi-byte to 8-bit encoding */
3512- p = string_convert (& prt_conv , p , & len );
3513- if (p == NULL )
3514- p = (char_u * )"" ;
3515- }
3512+ tofree = p = string_convert (& prt_conv , p , & len );
35163513
35173514 if (prt_out_mbyte )
35183515 {
35193516 /* Multi-byte character strings are represented more efficiently as hex
35203517 * strings when outputting clean 8 bit PS.
35213518 */
3522- do
3519+ while ( len -- > 0 )
35233520 {
35243521 ch = prt_hexchar [(unsigned )(* p ) >> 4 ];
35253522 ga_append (& prt_ps_buffer , ch );
35263523 ch = prt_hexchar [(* p ) & 0xf ];
35273524 ga_append (& prt_ps_buffer , ch );
35283525 p ++ ;
35293526 }
3530- while (-- len );
35313527 }
35323528 else
35333529#endif
@@ -3574,8 +3570,7 @@ mch_print_text_out(char_u *p, int len UNUSED)
35743570
35753571#ifdef FEAT_MBYTE
35763572 /* Need to free any translated characters */
3577- if (prt_do_conv && (* p != NUL ))
3578- vim_free (p );
3573+ vim_free (tofree );
35793574#endif
35803575
35813576 prt_text_run += char_width ;
Original file line number Diff line number Diff line change @@ -771,6 +771,8 @@ static char *(features[]) =
771771
772772static int included_patches [] =
773773{ /* Add new patch number below this line */
774+ /**/
775+ 1503 ,
774776/**/
775777 1502 ,
776778/**/
You can’t perform that action at this time.
0 commit comments