+2003-01-20 Kenichi Handa <handa@m17n.org>
+
+ * editfns.c (Fformat): Update thissize from field_width based on
+ the actual width, in the string case (back-porting of the
+ 2002-01-02 change in HEAD).
+
2003-01-17 Francesco Potort\e,Al\e(B <pot@gnu.org>
* Version 21.3 released.
if (*format++ == '%')
{
int thissize = 0;
+ int actual_width = 0;
unsigned char *this_format_start = format - 1;
int field_width, precision;
if (*format != 's' && *format != 'S')
error ("Format specifier doesn't match argument type");
thissize = CONVERTED_BYTE_SIZE (multibyte, args[n]);
+ actual_width = lisp_string_width (args[n], -1, NULL, NULL);
}
/* Would get MPV otherwise, since Lisp_Int's `point' to low memory. */
else if (INTEGERP (args[n]) && *format != 's')
goto string;
}
- thissize = max (field_width, thissize);
+ thissize += max (0, field_width - actual_width);
total += thissize + 4;
}