Commit Graph

34 Commits

Author SHA1 Message Date
Adrian Chadd
14679cb2f3 [bc] Fix a "maybe uninitialized" compiler warning under mips-gcc-6.3.0.
I guess this didn't like the case statements.. ? But this does quieten
the compiler error.
2020-07-14 05:02:18 +00:00
Stefan Eßer
cf7becd216 Update to version 3.1.3
This version fixes the following evaluation, which lead to a parse error:

     echo "if (1 < 3) 1" | bc
2020-07-11 07:33:18 +00:00
Stefan Eßer
3aa99676b4 Update to version 3.1.1
This version fixes a regression with regard to tradtional behavior of the
non-standard FreeBSD option "-e". In the previous version "-e quit" caused
bc to exit before any computations had been performed, since all -e option
parameters were concatenated and parsed as a whole, with quit causing the
program to exit as soon as it was parsed. This version parses and executes
commands passed with -e one by one and only exits after all prior commands
have been executed.

This commit is not a SVN merge, since the vendor import had been performed
after the import to contrib. Instead the contents of contrib/bc has been
removed and the new version is copied over unchanged from vendor/bc/dist.
2020-07-07 07:51:09 +00:00
Stefan Eßer
252884ae7e Import new 2-clause BSD licenced implementation of the bc and dc commands
These implementations of the bc and dc programs offer a number of advantages
compared to the current implementations in the FreeBSD base system:

- They do not depend on external large number functions (i.e. no dependency
  on OpenSSL or any other large number library)

- They implements all features found in GNU bc/dc (with the exception of
  the forking of sub-processes, which the author of this version considers
  as a security issue).

- They are significantly faster than the current code in base (more than
  2 orders of magnitude in some of my tests, e.g. for 12345^100000).

- They should be fully compatible with all features and the behavior of the
  current implementations in FreeBSD (not formally verified).

- They support POSIX message catalogs and come with localized messages in
  Chinese, Dutch, English, French, German, Japanese, Polish, Portugueze,
  and Russian.

- They offer very detailed man-pages that provide far more information than
  the current ones.

The upstream sources contain a large number of tests, which are not
imported with this commit. They could be integrated into our test
framework at a latter time.

Installation of this version is controlled by the option "MK_GH_BC=yes".
This option will be set to yes by default in 13-CURRENT, but will be off
by default in 12-STABLE.

Approved by:	imp
Obtained from:	https://git.yzena.com/gavin/bc
MFC after:	4 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D19982
2020-06-27 12:02:01 +00:00
Gabor Kovesdan
5e72825fcd - Remove GNU bc/dc bits. There has not been any regressions seen after
BSD bc/dc import. It has been tested with make universe that this code
  is not used by anything any more.

Approved by:	delphij (mentor)
2010-02-21 14:28:03 +00:00
Brooks Davis
c283464ab7 s/predefine/predefined/
PR:		gnu/86627
Submitted by:	Arne Woerner <arne_woerner at yahoo dot com>
MFC After:	6 days
2006-01-24 06:38:35 +00:00
Brooks Davis
92b4183c54 s/routnes/routines/ in help message.
This file is already off the vendor branch and there hasn't been a bc
release in more than 4 years so I can't see any harm in fixing this.

Submitted by:	Arne Woerner <arne_woerner at yahoo dot com>
PR:		gnu/86627
2005-09-27 18:52:17 +00:00
Andrey A. Chernov
e7c820ec07 Remove files no longer needed 2004-02-17 01:04:18 +00:00
Andrey A. Chernov
0bd7aa5188 getopt_long() returned 0 (i.e. long options) case not handled, add it
(symptom: "bc --quiet" not works while "bc -q" works)
2004-02-17 00:53:50 +00:00
Sheldon Hearn
f93e740631 This commit was generated by cvs2svn to compensate for changes in r90238,
which included commits to RCS files with non-trunk default branches.
2002-02-05 09:17:24 +00:00
Sheldon Hearn
5fa4faea8e Fix obscure bug in code loading support that could cause parsing of
functions in multi-line files to fail, depending on the state of the
stack.  The fix is sanctioned by the vendor and will appear in bc-1.07.

PR:		bin/34601
Reported by:	mi
Obtained from:	Phil Nelson <phil@cs.wwu.edu>
2002-02-05 09:17:24 +00:00
Peter Wemm
f8be0f6af6 Remove files that were not part of the bc-1.06 import. 2001-11-04 06:20:02 +00:00
Ruslan Ermilov
b50288009d Fixed warning:
bc.1:643: warning: numeric expression expected (got `e')
2001-07-12 07:35:06 +00:00
Andrey A. Chernov
c8f896e658 Remove conflicting readline prototype 2001-04-11 04:07:38 +00:00
Kris Kennaway
4674b9b242 Resolve conflicts 2001-02-26 07:17:03 +00:00
Kris Kennaway
a078a05252 Initial import of bc 1.0.6 2001-02-26 07:13:00 +00:00
Kris Kennaway
f506601163 This commit was generated by cvs2svn to compensate for changes in r73064,
which included commits to RCS files with non-trunk default branches.
2001-02-26 07:13:00 +00:00
David E. O'Brien
d98b1e1d59 Update this for the recient import. 2000-01-16 10:22:31 +00:00
David E. O'Brien
ca4d36dde4 Merge rev 1.2 into BC 1.0.5a, which fixes a spelling error. 2000-01-16 10:14:50 +00:00
David E. O'Brien
094b5d2f25 GNU has figured out they should fix the bug we fixed in rev 1.2 themselves.
So return this file back to the stock version.
2000-01-16 10:10:15 +00:00
David E. O'Brien
65865e2a46 Import GNU bc 1.05a. 2000-01-16 10:01:07 +00:00
David E. O'Brien
9641ce7adc This commit was generated by cvs2svn to compensate for changes in r56101,
which included commits to RCS files with non-trunk default branches.
2000-01-16 10:01:07 +00:00
Nick Hibma
d6e5fcdb70 bc core dumped when a value with between 128 and 255 (mod 256) digits
was entered.

PR:		12550
Submitted by:	Vladimir Tchoukharev chu@gpi.ru
Reviewed by:	Phil Nelson <phil@cs.wwu.edu> (maintainer of bc)
1999-07-28 17:58:12 +00:00
Poul-Henning Kamp
982fe76ef9 s/the the/to the/
PR:		7922
Reviewed by:	phk
Submitted by:	Kaneda Hiloshi <vanitas@ma3.seikyou.ne.jp>
1998-09-17 08:56:03 +00:00
John Polstra
5297a0bee0 This file has been renamed to FREEBSD-upgrade in accordance with the
Policies section of the Handbook.

Submitted by:	"David O'Brien" <obrien>
1998-08-28 04:53:23 +00:00
Steve Price
32c2131395 Fix a bunch of spelling errors.
PR:		6856
Submitted by:	Josh Gilliam <josh@quick.net>
1998-06-04 21:06:07 +00:00
Poul-Henning Kamp
84717b42e8 .Sh ENVIRONMENT VARIABLES -> .Sh ENVIRONMENT
PR:		6599
Reviewed by:	phk
Submitted by:	Josh Gilliam <josh@quick.net>
1998-05-13 07:57:49 +00:00
Andrey A. Chernov
18a34ccf77 Back out complex and semi-correct workaround and commit one line fix
for 'echo' problem instead
1998-05-02 08:33:59 +00:00
John Birrell
376b0e97f4 If not interactive, we need the traditional behaviour of the input
not being echoed to the output. So as a _hack_ to get the world building
again, redirect the readline rl_outstream to stderr when not interactive.

The proper way to handle non-interactive mode is to read from stdin
and don't worry about edit mode, but this is GNU so it's not worth the
time thinking about. I'm already pissed off that I even had to look
at this "nice code".
1998-05-02 03:28:43 +00:00
Andrey A. Chernov
c2b2555816 Remove generated bc.h 1998-04-30 16:02:01 +00:00
Andrey A. Chernov
02f133e259 Add removed files to the removed list 1998-04-30 08:21:28 +00:00
Andrey A. Chernov
9890b24c74 Remove junk files that occupes space: Flex/Bison output and TeX macros 1998-04-30 08:00:49 +00:00
Andreas Klemm
da63d8f279 Added short instruction for FreeBSD how to import 1998-04-29 21:57:35 +00:00
Andreas Klemm
17f33912d7 Import GNU bc 1.04
PR:		4183
1998-04-29 21:53:01 +00:00