summaryrefslogtreecommitdiff
path: root/usr.bin/dc
AgeCommit message (Collapse)Author
2024-11-07Use LibreSSLs specialized functions to print base 10 and base 16.Otto Moerbeek
Also optimize the general case a bit. ok semarie@
2024-04-23correct indentation; no functional changeJonathan Gray
ok tb@
2023-03-08Delete obsolete /* ARGSUSED */ lint comments.Philip Guenther
ok miod@ millert@
2021-11-10Move two BIGNUMs in printnumber() from the stack to the heap toTheo Buehler
prepare bc(1) and dc(1) for opaque BIGNUMs. "looks sane" otto
2021-03-08Add some references, most of these were removed when we stopped buildingJonathan Gray
and installing USD/SMM/PSD docs. jmc@ agrees with the direction, ok millert@ on an earlier diff
2019-09-06More Version 1 AT&T UNIX history.Ingo Schwarze
This became possible because copies of the original v1 manuals have shown up on the Internet some time ago. Reminded by Sevan Janiyan <venture37 at geeklan dot co dot uk>.
2017-12-29small optimization in bexp; from ksheOtto Moerbeek
2017-12-17Use proper BN functions for error reporting; from ksheOtto Moerbeek
2017-12-12Use bn_checkp() always; from ksheOtto Moerbeek
2017-12-12Minor cleanup from ksheOtto Moerbeek
2017-12-12optimize add, sub and mul; from kshe; ok tom@Otto Moerbeek
2017-12-07zap a few stray backslashes from the time thesse two were #defines; fromOtto Moerbeek
Ilya Kaliman
2017-12-06strdup -> bstrdup; from Michael W. BombardieriOtto Moerbeek
2017-12-05use a global BN_CTX; from kshe with a twist from myselfOtto Moerbeek
2017-12-02make 0Z do what the original dc and gnu bcc do; ok tom@Otto Moerbeek
2017-12-02Add a caveat wrt use of non-decimal fractional notation; from kshe; ok jmc@Otto Moerbeek
2017-12-01fix buglet in split_number() and optimize count_digits();Otto Moerbeek
from kshe with a twist from myself; ok tb@
2017-11-29fold bsqrt_stop into bsqrt; from kshe; ok tom@Otto Moerbeek
2017-11-29simplify print_ascii; from kshe; ok tom@Otto Moerbeek
2017-11-29Pledge can be done earlier; from ksheOtto Moerbeek
2017-11-28zap newline in warn(); from ksheOtto Moerbeek
2017-11-28zap dead stores; prompted by a diff from ksheOtto Moerbeek
2017-11-28garbage collect a few functions that are not really needed; from ksheOtto Moerbeek
2017-11-28document that the 'e' command is non-portable; from kshe; ok jmc@Otto Moerbeek
2017-11-27Safer handling of the jump_table[] in dc's bcode.cTom Cosgrove
Based on a diff sent to tech@ by kshe59 (at)zoho (dot) eu - thanks ok otto@, who also remembered to check the regression tests
2017-02-26Move away from BN_zero, the one returning an int is deprecated and theOtto Moerbeek
new one is a void function. From Daniel Cegielka.
2017-02-23Introduce e command, equivalent to p, but writes to stderrOtto Moerbeek
2016-12-10replace all references to bn(3) with BN_new(3),Ingo Schwarze
and make sure all BN*(3) pages point back to BN_new(3)
2016-07-17getopt(3) can be called twice (once for bc and once for dc), so reinit getoptOtto Moerbeek
ok deraadt@
2016-03-27some style(9) and redundant tests for NULL, from Michael W. BombardieriOtto Moerbeek
2015-11-03Surround pledge calls with blank lines.mmcc
2015-10-10Rather than invoking fork/execve of dc(1) on a pipe, compile in the dc(1)Theo de Raadt
code directly and use it as a subfunction. This refactoring allows use of pledge "stdio rpath proc tty" in the main bc(1) process before fork, pledge "stdio rpath tty" after fork, and fully reduced to "stdio" in the dc(1) child. This requires two recent to the kernel code (allowing sigsuspend(), and kill() self as pid 0). ok otto
2015-10-09Change all tame callers to namechange to pledge(2).Theo de Raadt
2015-10-03Now that dc(1) no longer supports !command with popen(), we can startTheo de Raadt
off with tame "stdio rpath". Once the (optional) file is opened, a further drop down to tame "stdio" works.
2015-10-03delete documentation for ! commandTheo de Raadt
2015-10-03disable ! command, makes dc(1) more tameableOtto Moerbeek
2015-02-16Include bn.h and err.h from <openssl/...>, not the old <ssl/...> location.Jeremie Courreges-Anglas
Remove unneeded ssl.h includes. Also built-checked against openssl-1.0.1e. ok otto@
2014-12-01more opportunity to use reallocarray(); ok ottoTheo de Raadt
2014-11-26Prefer setvbuf() to setlinebuf() for portability; ok deraadt@Todd C. Miller
2014-11-26init array field in the proper place, see regress test t27;Otto Moerbeek
from Sebastien Marie
2014-10-08userland reallocarray audit.Doug Hogan
Replace malloc() and realloc() calls that may have integer overflow in the multiplication of the arguments with reallocarray(). ok deraadt@
2014-05-20Use errc/warnc to simplify code.Philip Guenther
Also, in 'ftp', always put the error message last, after the hostname/ipaddr. ok jsing@ krw@ millert@
2012-11-07fix fractional number exponentiation, especially for negative exponentsOtto Moerbeek
2012-11-06use BN_set_negative() and BN_is_negative() instead of subtracting orOtto Moerbeek
comparing to zero
2012-11-06For exponenttion, only warn if the fractional part of the exponentOtto Moerbeek
is non-zero and avoid div by zero. Prompted by Andres Perera.
2012-08-19Stefan Unterweger pointed out that, contrary to the man page,Jason McIntyre
dc exited after processing any expressions and/or files; this is the doc fix, as requested by (and ok) otto
2012-03-08let length(0.000) conform to what gnu bc does; from AIDA ShinraOtto Moerbeek
2010-10-18more usd/psd stuff lurking...Jason McIntyre
2010-09-19more wacky macro fixing;Jason McIntyre
2010-05-15normalize() cannot be inline and extern at the same time; prompted byOtto Moerbeek
jsg@