fixed incorrect processing of decimal separator

This commit is contained in:
Zdenek Prikryl 2007-08-22 06:49:20 +00:00
parent 0ef65d232f
commit a1e3484117
2 changed files with 20 additions and 4 deletions

View File

@ -1,5 +1,5 @@
--- bc-1.06/dc/numeric.c.dc_ibase 2000-08-31 17:57:42.000000000 +0200
+++ bc-1.06/dc/numeric.c 2007-07-26 15:47:42.000000000 +0200
--- bc-1.06/dc/numeric.c.dc_ibase 2007-08-22 08:37:57.000000000 +0200
+++ bc-1.06/dc/numeric.c 2007-08-22 08:37:40.000000000 +0200
@@ -285,6 +285,8 @@ dc_getnum DC_DECLARG((input, ibase, read
int digit;
int decimal;
@ -36,7 +36,19 @@
}
if (c == '.'){
bc_free_num(&build);
@@ -328,6 +338,7 @@ dc_getnum DC_DECLARG((input, ibase, read
@@ -321,13 +331,18 @@ dc_getnum DC_DECLARG((input, ibase, read
build = bc_copy_num(_zero_);
decimal = 0;
for (;;){
- c = (*input)();
+ if (c_buff) {
+ c = c_buff;
+ c_buff = 0;
+ } else
+ c = (*input)();
if (isdigit(c))
digit = c - '0';
else if ('A' <= c && c <= 'F')
digit = 10 + c - 'A';
else
break;

View File

@ -1,7 +1,7 @@
Summary: GNU's bc (a numeric processing language) and dc (a calculator)
Name: bc
Version: 1.06
Release: 27
Release: 28
License: GPL
URL: http://www.gnu.org/software/bc/
Group: Applications/Engineering
@ -70,6 +70,10 @@ exit 0
%{_infodir}/*
%changelog
* Thu Aug 22 2007 Zdenek Prikryl <zprikryl@redhat.com> 1.06-28
- fixed incorrect processing of decimal separator
- Resolves: #253729
* Thu Jul 26 2007 Zdenek Prikryl <zprikryl@redhat.com> 1.06-27
- dc accepts the input which contains wrong symbols of radix in same way like bc
- Resolves: #151844