Spotted while working on kshe's diff.

Makes Z0p work the same as both gnu dc and the orignal dc.

OK?

        -Otto

Index: usr.bin/dc/bcode.c
===================================================================
RCS file: /cvs/src/usr.bin/dc/bcode.c,v
retrieving revision 1.57
diff -u -p -r1.57 bcode.c
--- usr.bin/dc/bcode.c  1 Dec 2017 19:04:15 -0000       1.57
+++ usr.bin/dc/bcode.c  2 Dec 2017 07:47:09 -0000
@@ -705,7 +705,7 @@ count_digits(const struct number *n)
        int             bits;
 
        if (BN_is_zero(n->number))
-               return n->scale ? n->scale : 1;
+               return n->scale ? n->scale : 0;
 
        int_part = BN_new();
        bn_checkp(int_part);
Index: regress/usr.bin/dc/t1.out
===================================================================
RCS file: /cvs/src/regress/usr.bin/dc/t1.out,v
retrieving revision 1.4
diff -u -p -r1.4 t1.out
--- regress/usr.bin/dc/t1.out   3 Oct 2015 16:25:33 -0000       1.4
+++ regress/usr.bin/dc/t1.out   2 Dec 2017 07:47:09 -0000
@@ -8,7 +8,7 @@
 0
 3
 7
-1
+0
 1
 1
 15
Index: regress/usr.bin/dc/t28.out
===================================================================
RCS file: /cvs/src/regress/usr.bin/dc/t28.out,v
retrieving revision 1.1
diff -u -p -r1.1 t28.out
--- regress/usr.bin/dc/t28.out  1 Dec 2017 08:40:04 -0000       1.1
+++ regress/usr.bin/dc/t28.out  2 Dec 2017 07:47:09 -0000
@@ -1,4 +1,4 @@
-1
+0
 1
 2
 2
Index: regress/usr.bin/dc/t4.in
===================================================================
RCS file: /cvs/src/regress/usr.bin/dc/t4.in,v
retrieving revision 1.1
diff -u -p -r1.1 t4.in
--- regress/usr.bin/dc/t4.in    21 Sep 2003 19:30:07 -0000      1.1
+++ regress/usr.bin/dc/t4.in    2 Dec 2017 07:47:09 -0000
@@ -1,2 +1,2 @@
 [From [email protected]]sd
-[100SdSn lnld/ 
LnLd%Plax]sb16i0A2172656B63616820636420726568746F6E61207473754A[dZ1!=b]salax
+[100SdSn lnld/ 
LnLd%Plax]sb16i0A2172656B63616820636420726568746F6E61207473754A[dZ0!=b]salax

Reply via email to