X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fdoprnt.c;h=3e4c3cefdb2f846530c0dcd7b5e4d08be465ab8b;hb=3aca7317dd930beecbddba646284279744087e69;hp=fabbf999a9ca89b65b0a1a384f67ef27050a8450;hpb=3e447015251ce6dcde843cbed10d9033d5538622;p=chise%2Fxemacs-chise.git- diff --git a/src/doprnt.c b/src/doprnt.c index fabbf99..3e4c3ce 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -657,16 +657,24 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, long_to_string (constructed_spec + strlen (constructed_spec), spec->precision); } +#if 0 sprintf (constructed_spec + strlen (constructed_spec), "%c", ch); +#endif /* sprintf the mofo */ /* we have to use separate calls to sprintf(), rather than a single big conditional, because of the different types of the arguments */ if (strchr (double_converters, ch)) - sprintf (text_to_print, constructed_spec, arg.d); + { + sprintf (constructed_spec + strlen (constructed_spec), + "%c", ch); + sprintf (text_to_print, constructed_spec, arg.d); + } else if (strchr (unsigned_int_converters, ch)) { + sprintf (constructed_spec + strlen (constructed_spec), + "%c", ch); if (spec->l_flag) sprintf (text_to_print, constructed_spec, arg.ul); else @@ -674,6 +682,12 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, } else { + if (spec->zero_flag && spec->minwidth) + sprintf (constructed_spec + strlen (constructed_spec), + "0%d%c", spec->minwidth, ch); + else + sprintf (constructed_spec + strlen (constructed_spec), + "%c", ch); if (spec->l_flag) sprintf (text_to_print, constructed_spec, arg.l); else