diff options
| author | Michael Welsh Duggan | 2011-02-14 17:25:29 -0500 |
|---|---|---|
| committer | Chong Yidong | 2011-02-14 17:25:29 -0500 |
| commit | 75b43359dd68edd356d9f611ebc3dd5b477fa637 (patch) | |
| tree | 2a2deaeb8fc360762e77a4596d6c7e1b65c511f9 | |
| parent | aa0935b987a4a10e8adcd1af64ea4fc10e860e54 (diff) | |
| download | emacs-75b43359dd68edd356d9f611ebc3dd5b477fa637.tar.gz emacs-75b43359dd68edd356d9f611ebc3dd5b477fa637.zip | |
Fix use of dtoastr from gnulib.
* src/print.c (float_to_string): Ensure that a decimal point is
printed if using dtoastr (Bug#8033).
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/print.c | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2f5749238ff..e3a3137e482 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-02-14 Michael Welsh Duggan <md5i@md5i.com> | ||
| 2 | |||
| 3 | * print.c (float_to_string): Ensure that a decimal point is | ||
| 4 | printed if using dtoastr (Bug#8033). | ||
| 5 | |||
| 1 | 2011-02-14 Eli Zaretskii <eliz@gnu.org> | 6 | 2011-02-14 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * msdos.c (IT_frame_up_to_date): | 8 | * msdos.c (IT_frame_up_to_date): |
diff --git a/src/print.c b/src/print.c index b5b278bf17f..beb14a8b679 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -1062,7 +1062,10 @@ float_to_string (char *buf, double data) | |||
| 1062 | { | 1062 | { |
| 1063 | /* Generate the fewest number of digits that represent the | 1063 | /* Generate the fewest number of digits that represent the |
| 1064 | floating point value without losing information. */ | 1064 | floating point value without losing information. */ |
| 1065 | dtoastr (buf, FLOAT_TO_STRING_BUFSIZE, 0, 0, data); | 1065 | dtoastr (buf, FLOAT_TO_STRING_BUFSIZE - 2, 0, 0, data); |
| 1066 | /* The decimal point must be printed, or the byte compiler can | ||
| 1067 | get confused (Bug#8033). */ | ||
| 1068 | width = 1; | ||
| 1066 | } | 1069 | } |
| 1067 | else /* oink oink */ | 1070 | else /* oink oink */ |
| 1068 | { | 1071 | { |
| @@ -1117,8 +1120,7 @@ float_to_string (char *buf, double data) | |||
| 1117 | cp[1] = '0'; | 1120 | cp[1] = '0'; |
| 1118 | cp[2] = 0; | 1121 | cp[2] = 0; |
| 1119 | } | 1122 | } |
| 1120 | 1123 | else if (*cp == 0) | |
| 1121 | if (*cp == 0) | ||
| 1122 | { | 1124 | { |
| 1123 | *cp++ = '.'; | 1125 | *cp++ = '.'; |
| 1124 | *cp++ = '0'; | 1126 | *cp++ = '0'; |