CVS update by aidan xemacs/tests/automated ...
xemacs-cvs at xemacs.org
xemacs-cvs at xemacs.org
Tue Nov 27 08:51:10 EST 2007
User: aidan
Date: 07/11/27 14:51:10
Modified: xemacs/tests/automated lisp-tests.el
Log:
Merge a bugfix to some previously merged SXEmacs code; thank you Sebastian
Freundt for the code, and Hans de Graaff for the report.
Revision Changes Path
1.97 +6 -0 XEmacs/xemacs/tests/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/ChangeLog,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -p -r1.96 -r1.97
--- ChangeLog 2007/10/01 08:07:56 1.96
+++ ChangeLog 2007/11/27 13:51:03 1.97
@@ -1,3 +1,9 @@
+2007-11-26 Aidan Kehoe <kehoea at parhasard.net>
+
+ * automated/lisp-tests.el:
+ Check that a couple of previously problematic calls to #'format
+ succeed.
+
2007-09-30 Stephen J. Turnbull <stephen at xemacs.org>
* automated/os-tests.el: Suppress `executable-find' lossage.
1.1109 +9 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.1108
retrieving revision 1.1109
diff -u -p -r1.1108 -r1.1109
--- ChangeLog 2007/11/15 19:05:47 1.1108
+++ ChangeLog 2007/11/27 13:51:05 1.1109
@@ -1,3 +1,12 @@
+2007-11-26 Aidan Kehoe <kehoea at parhasard.net>
+
+ * doprnt.c:
+ Default to a buffer size of 350 for the sprintf call, but increase
+ it if the precision and minwidth indicate that it should be
+ bigger. Issue reported by Hans de Graaff; bug originally fixed by
+ Sebastian Freundt in SXEmacs following the change I merged on
+ 2006-11-28. Forks have their disadvantages.
+
2007-11-11 Mats Lidell <matsl at xemacs.org>
* events.h: Based on SXEmacs patch. Support for mouse button 6 to
1.33 +13 -1 XEmacs/xemacs/src/doprnt.c
Index: doprnt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/doprnt.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -p -r1.32 -r1.33
--- doprnt.c 2006/11/28 16:09:47 1.32
+++ doprnt.c 2007/11/27 13:51:07 1.33
@@ -776,9 +776,21 @@ emacs_doprnt_1 (Lisp_Object stream, cons
#endif /* HAVE_BIGFLOAT */
else
{
- Ascbyte *text_to_print = alloca_array (char, 350);
+ Ascbyte *text_to_print;
Ascbyte constructed_spec[100];
Ascbyte *p = constructed_spec;
+ int alloca_sz = 350;
+ int min = spec->minwidth, prec = spec->precision;
+
+ if (prec < 0)
+ prec = 0;
+ if (min < 0)
+ min = 0;
+
+ if (32+min+prec > alloca_sz)
+ alloca_sz = 32 + min + prec;
+
+ text_to_print = alloca_array(char, alloca_sz);
/* Mostly reconstruct the spec and use sprintf() to
format the string. */
1.8 +4 -0 XEmacs/xemacs/tests/automated/lisp-tests.el
Index: lisp-tests.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/automated/lisp-tests.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- lisp-tests.el 2004/05/13 15:33:18 1.7
+++ lisp-tests.el 2007/11/27 13:51:10 1.8
@@ -1279,6 +1279,10 @@
(Assert (= (read (format "%d" most-negative-fixnum)) most-negative-fixnum))
(Assert (= (read (format "%ld" most-negative-fixnum)) most-negative-fixnum))
+;; These used to crash.
+(Assert (eql (read (format "%f" 1.2e+302)) 1.2e+302))
+(Assert (eql (read (format "%.1000d" 1)) 1))
+
;;; "%u" is undocumented, and Emacs Lisp has no unsigned type.
;;; What to do if "%u" is used with a negative number?
;;; For non-bignum XEmacsen, the most reasonable thing seems to be to print an
More information about the XEmacs-CVS
mailing list