git: dc(1): Sync with OpenBSD

Joris Giovannangeli joris at crater.dragonflybsd.org
Fri Sep 20 15:21:07 PDT 2013


commit a977bf879651837d1fcee810ad28506cb5334300
Author: Joris Giovannangeli <joris at dragonflybsd.org>
Date:   Fri Sep 20 23:31:56 2013 +0200

    dc(1): Sync with OpenBSD
    
    Changes include :
    
     * show an error message if the argument is a dir
    
     * check value against UINT_MAX before casting to u_int; while
       there fix a buglet in bexp(): x * UINT_MAX only overflows if x > 0
    
     * fix fractional number exponentiation
    
     * use BN_set_negative() and BN_is_negative() instead of subtracting or
       comparing to zero
    
     * For exponenttion, only warn if the fractional part of the exponent
       is non-zero and avoid div by zero.
    
     * let length(0.000) conform to what gnu bc does
    
     * check for unitialized elements when accessing an array
    
     * although there's no EOF condition defined for the handling of '?',
       but anyway reset the eof condition on stdin, so you don't get an
       infinite loop in the typical program after a ^D.
    
     * convert malloc to calloc
    
     * fix three leaks
    
     * use size_t as stack size and ssize_t as stack pointer
    
     * add missing bn_check
    
    Revision for updated OpenBSD files are :
    
     - bcode.c : 1.45
     - bcode.h : 1.7
     - dc.c : 1.11
     - inout.c : 1.17
     - stack.c : 1.11
    
    Obtained-from: OpenBSD

Summary of changes:
 usr.bin/dc/bcode.c  | 137 +++++++++++++++++++++++++++++++---------------------
 usr.bin/dc/bcode.h  |  13 +++--
 usr.bin/dc/dc.c     |  12 ++++-
 usr.bin/dc/extern.h |   4 +-
 usr.bin/dc/inout.c  |  40 +++++++--------
 usr.bin/dc/stack.c  |  17 ++++---
 6 files changed, 128 insertions(+), 95 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a977bf879651837d1fcee810ad28506cb5334300


-- 
DragonFly BSD source repository



More information about the Commits mailing list