[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r99661: Fix bug in `format' (Bug#5710
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r99661: Fix bug in `format' (Bug#5710). |
Date: |
Sat, 13 Mar 2010 14:54:29 -0500 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 99661
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2010-03-13 14:54:29 -0500
message:
Fix bug in `format' (Bug#5710).
* editfns.c (Fformat): Account for string precision when computing
field width (Bug#5710).
modified:
src/ChangeLog
src/editfns.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2010-03-13 08:52:05 +0000
+++ b/src/ChangeLog 2010-03-13 19:54:29 +0000
@@ -1,3 +1,8 @@
+2010-03-13 Andreas Politz <address@hidden> (tiny change)
+
+ * editfns.c (Fformat): Account for string precision when computing
+ field width (Bug#5710).
+
2010-03-12 Chong Yidong <address@hidden>
* xfns.c (Fx_create_frame): Set default to Qright.
=== modified file 'src/editfns.c'
--- a/src/editfns.c 2010-01-18 16:29:00 +0000
+++ b/src/editfns.c 2010-03-13 19:54:29 +0000
@@ -3782,7 +3782,11 @@
to be as large as is calculated here. Easy check for
the case PRECISION = 0. */
thissize = precision[n] ? CONVERTED_BYTE_SIZE (multibyte, args[n])
: 0;
+ /* The precision also constrains how much of the argument
+ string will finally appear (Bug#5710). */
actual_width = lisp_string_width (args[n], -1, NULL, NULL);
+ if (precision[n] != -1)
+ actual_width = min(actual_width,precision[n]);
}
/* Would get MPV otherwise, since Lisp_Int's `point' to low memory. */
else if (INTEGERP (args[n]) && *format != 's')
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r99661: Fix bug in `format' (Bug#5710).,
Chong Yidong <=