OpenBSD CVS

CVS log for src/usr.bin/bc/bc.y


[BACK] Up to [local] / src / usr.bin / bc

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.53 / (download) - annotate - [select for diffs], Wed Mar 8 04:43:10 2023 UTC (14 months, 1 week ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.52: +1 -2 lines
Diff to previous 1.52 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.52 / (download) - annotate - [select for diffs], Tue Jun 30 14:27:02 2020 UTC (3 years, 10 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.51: +3 -1 lines
Diff to previous 1.51 (colored)

Fix potential out-of-bounds copy; spotted by Jakub Jirasek, Secunia Research
at Flexera. ok deraadt@

Revision 1.51 / (download) - annotate - [select for diffs], Sun Jul 2 23:19:07 2017 UTC (6 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (colored)

whitespace

Revision 1.50 / (download) - annotate - [select for diffs], Thu Feb 23 06:41:46 2017 UTC (7 years, 2 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.49: +4 -3 lines
Diff to previous 1.49 (colored)

- write parse errors to stderr, prompted by Martijn Dekker
- we're only interactive if stdout en stderr are a tty as well as stdin

Revision 1.49 / (download) - annotate - [select for diffs], Mon Nov 23 09:58:55 2015 UTC (8 years, 5 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.48: +15 -10 lines
Diff to previous 1.48 (colored)

- fix printing of non-ascii chars in error message
- solve a couple of problems found by Michael McConville using
afl: printing of null nodes, and generating cyclic "trees". These
can only happen on invalid input, afaik.
ok benno@

Revision 1.48 / (download) - annotate - [select for diffs], Sat Oct 10 19:28:54 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.47: +16 -3 lines
Diff to previous 1.47 (colored)

Rather than invoking fork/execve of dc(1) on a pipe, compile in the dc(1)
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

Revision 1.47 / (download) - annotate - [select for diffs], Wed Nov 26 18:34:51 2014 UTC (9 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored)

Prefer setvbuf() to setlinebuf() for portability; ok deraadt@

Revision 1.46 / (download) - annotate - [select for diffs], Tue Oct 14 15:35:18 2014 UTC (9 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

obvious use of reallocarray()

Revision 1.45 / (download) - annotate - [select for diffs], Wed Oct 8 04:13:33 2014 UTC (9 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored)

reallocarray() to detect integer overflow; ok doug

Revision 1.44 / (download) - annotate - [select for diffs], Wed Nov 20 21:33:54 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.43: +3 -2 lines
Diff to previous 1.43 (colored)

unsigned char casts for ctype.h macros, when dealing with the
yytext buffer
ok benno

Revision 1.43 / (download) - annotate - [select for diffs], Tue Nov 12 13:54:51 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

simpler prototype repairs

Revision 1.42 / (download) - annotate - [select for diffs], Thu Sep 19 16:12:01 2013 UTC (10 years, 8 months ago) by otto
Branch: MAIN
Changes since 1.41: +1 -3 lines
Diff to previous 1.41 (colored)

separate termios.h out from scan.l, both have an ECHO define. Noted by
Joris Giovannangeli.

Revision 1.41 / (download) - annotate - [select for diffs], Thu Mar 8 08:20:08 2012 UTC (12 years, 2 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.40: +14 -14 lines
Diff to previous 1.40 (colored)

allow editline in -d mode; from AIDA Shinra

Revision 1.40 / (download) - annotate - [select for diffs], Thu Oct 6 14:37:56 2011 UTC (12 years, 7 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.39: +5 -1 lines
Diff to previous 1.39 (colored)

Better error message on unexpected newline; noted by and ok deraadt@

Revision 1.39 / (download) - annotate - [select for diffs], Wed Aug 3 08:48:19 2011 UTC (12 years, 9 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.38: +6 -3 lines
Diff to previous 1.38 (colored)

save/restore tty state on SIGTSTP/SIGCONT. ok deraadt@ nicm@

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jul 8 23:29:46 2011 UTC (12 years, 10 months ago) by tedu
Branch: MAIN
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored)

el_set with EL_BIND needs sentinel NULL.  with help from nicm

Revision 1.37 / (download) - annotate - [select for diffs], Fri Jun 3 06:52:37 2011 UTC (12 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.36: +3 -2 lines
Diff to previous 1.36 (colored)

protect errno from damage in the signal handler
ok otto

Revision 1.36 / (download) - annotate - [select for diffs], Fri Jun 3 06:10:31 2011 UTC (12 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.35: +3 -1 lines
Diff to previous 1.35 (colored)

Make ^D behave: dont't echo it and make it work if the cursor is at
start of line after a ^C;  ok okan@ deraadt@

Revision 1.35 / (download) - annotate - [select for diffs], Wed Jun 1 07:18:23 2011 UTC (12 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

- avoid YY_FLUSH_BUFFER: it is not signal safe and it does not work as intended
after the introduction of editline
- honour editline edit off mode

Revision 1.34 / (download) - annotate - [select for diffs], Mon Mar 7 08:11:15 2011 UTC (13 years, 2 months ago) by otto
Branch: MAIN
Changes since 1.33: +19 -1 lines
Diff to previous 1.33 (colored)

add editline support; from freebsd. ok deraadt@

Revision 1.33 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:36 2009 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.32: +1 -5 lines
Diff to previous 1.32 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

Revision 1.32 / (download) - annotate - [select for diffs], Thu May 18 05:49:53 2006 UTC (18 years ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored)

Avoid segv when a syntax error occurs while reading from command line.
found by jmc@

Revision 1.31 / (download) - annotate - [select for diffs], Thu Apr 20 20:00:46 2006 UTC (18 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

unused variable

Revision 1.30 / (download) - annotate - [select for diffs], Fri Mar 31 09:57:26 2006 UTC (18 years, 1 month ago) by otto
Branch: MAIN
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored)

Better useage string. From Alexey Dobriyan.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Mar 18 21:05:50 2006 UTC (18 years, 2 months ago) by otto
Branch: MAIN
Changes since 1.28: +7 -4 lines
Diff to previous 1.28 (colored)

Forgotten part in previous commit; having multiple source trees is a
dangerous hobbby.

Revision 1.28 / (download) - annotate - [select for diffs], Sat Mar 18 20:44:43 2006 UTC (18 years, 2 months ago) by otto
Branch: MAIN
Changes since 1.27: +37 -7 lines
Diff to previous 1.27 (colored)

Interchange roles: bc becomes parent, dc child. This leads to saner
tty handling (try bc | grep foo followed by ^C, as noted by deraadt@).
To make it all work, bc now waits for dc to exit after giving it a
quit command.  ok deraadt@ jaredy@

Revision 1.27 / (download) - annotate - [select for diffs], Sun Sep 18 19:29:41 2005 UTC (18 years, 8 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.26: +8 -6 lines
Diff to previous 1.26 (colored)

Do not check pointer for NULL, but check for return value of asprintf(),
like the man page says.

Revision 1.26 / (download) - annotate - [select for diffs], Mon May 23 06:44:58 2005 UTC (19 years ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.25: +5 -5 lines
Diff to previous 1.25 (colored)

Fix some pedantic signed vs unsigned warnings. From Michael Knudsen, 10x

Revision 1.25 / (download) - annotate - [select for diffs], Thu Mar 17 16:59:31 2005 UTC (19 years, 2 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.24: +11 -4 lines
Diff to previous 1.24 (colored)

Fix eof without newline handling. spotted by and ok deraadt@

Revision 1.24 / (download) - annotate - [select for diffs], Tue Oct 19 07:36:51 2004 UTC (19 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.23: +21 -29 lines
Diff to previous 1.23 (colored)

Implement -e expression, for command line expression evaluation.
ok deraadt@

Revision 1.23 / (download) - annotate - [select for diffs], Wed Feb 18 07:43:58 2004 UTC (20 years, 3 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.22: +18 -11 lines
Diff to previous 1.22 (colored)

Rewrite argv processing to not alter argv[] and optind while in the
getopt() loop.
ok deraadt@

Revision 1.22 / (download) - annotate - [select for diffs], Tue Jan 13 08:43:23 2004 UTC (20 years, 4 months ago) by otto
Branch: MAIN
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored)

Missing cast. From deraadt@

Revision 1.21 / (download) - annotate - [select for diffs], Fri Dec 19 19:24:22 2003 UTC (20 years, 5 months ago) by otto
Branch: MAIN
Changes since 1.20: +2 -3 lines
Diff to previous 1.20 (colored)

Pass SIGINT to dc process.

Revision 1.20 / (download) - annotate - [select for diffs], Tue Dec 2 09:00:07 2003 UTC (20 years, 5 months ago) by otto
Branch: MAIN
Changes since 1.19: +125 -31 lines
Diff to previous 1.19 (colored)

o Introduce long variable names, a non-portable extension.
o Make main program target left recursive. Reduces parse stack usage, making
  it possible to compile programs > 10000 lines.

Revision 1.19 / (download) - annotate - [select for diffs], Mon Nov 17 11:20:13 2003 UTC (20 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.18: +50 -7 lines
Diff to previous 1.18 (colored)

Implement non-portable extensions:
o boolean operators !, && and ||.
o allow relational operators to appear in any expression, not just
  conditional expressions.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Nov 13 19:42:21 2003 UTC (20 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.17: +4 -5 lines
Diff to previous 1.17 (colored)

When using print, do not leave garbage on the dc stack.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Nov 13 19:05:32 2003 UTC (20 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

Exponentiation operatator ^ is right associative.

Revision 1.16 / (download) - annotate - [select for diffs], Tue Nov 11 19:49:02 2003 UTC (20 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.15: +15 -15 lines
Diff to previous 1.15 (colored)

Some syntactic sugar (all non-portable extensions):
- a line comment, starting with #
- opening brace of define statement may be on next line
- return expression, equivalent to return (expression)

Revision 1.15 / (download) - annotate - [select for diffs], Tue Nov 11 09:15:36 2003 UTC (20 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.14: +84 -3 lines
Diff to previous 1.14 (colored)

Implement `print' statement, a non-portable extension.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Oct 22 12:24:41 2003 UTC (20 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.13: +10 -2 lines
Diff to previous 1.13 (colored)

Implement if ... else statement. If you do not use 'else', code generated
is still classic dc(1) compatible. If you do use 'else', you'll need a dc(1)
that implements the new extended comparison operators like '=xey'.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Oct 19 19:21:48 2003 UTC (20 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.12: +21 -5 lines
Diff to previous 1.12 (colored)

Allow the expressions in for (E ; E ; E ) to be empty.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Oct 18 20:35:36 2003 UTC (20 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.11: +5 -5 lines
Diff to previous 1.11 (colored)

err(1, "cannot allocate mem") -> err(1, NULL)

Revision 1.11 / (download) - annotate - [select for diffs], Sat Oct 18 19:57:10 2003 UTC (20 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.10: +49 -8 lines
Diff to previous 1.10 (colored)

o Fix assignment operators (+=, -=, ... )
o Implement "continue" in loops. If continue is not used, generated code is
  still "classic" dc(1) compatible. If continue is used, you'll need a dc(1)
  that implements the J and M operators.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Sep 30 18:46:11 2003 UTC (20 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.9: +19 -6 lines
Diff to previous 1.9 (colored)

Make sure strings and error messages sent to dc(1) properly escape [, ] and \.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Sep 29 03:24:27 2003 UTC (20 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.8: +7 -4 lines
Diff to previous 1.8 (colored)

Implement (undocumented) dot shorthand, which was missing.
Spotted by millert@.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Sep 28 07:57:57 2003 UTC (20 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.7: +13 -13 lines
Diff to previous 1.7 (colored)

Better error hanndling:
- skip current line on syntax error
- detect EOF in strings and comments
- report correct line number in above case
- more consistent warning and errors

ok henning@

Revision 1.7 / (download) - annotate - [select for diffs], Sun Sep 28 07:45:55 2003 UTC (20 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.6: +5 -5 lines
Diff to previous 1.6 (colored)

Fix function return types. Unbreaks sparc64 compilation. Spotted by
sturm@.

ok deraadt@ sturm@ henning@

Revision 1.6 / (download) - annotate - [select for diffs], Fri Sep 26 19:26:16 2003 UTC (20 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.5: +4 -6 lines
Diff to previous 1.5 (colored)

minor tweaks as i fail to find real bugs

Revision 1.5 / (download) - annotate - [select for diffs], Fri Sep 26 19:06:46 2003 UTC (20 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

incorrect indent

Revision 1.4 / (download) - annotate - [select for diffs], Fri Sep 26 19:05:56 2003 UTC (20 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

make usage match man page

Revision 1.3 / (download) - annotate - [select for diffs], Fri Sep 26 19:00:38 2003 UTC (20 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (colored)

spacing

Revision 1.2 / (download) - annotate - [select for diffs], Fri Sep 26 07:23:06 2003 UTC (20 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.1: +4 -2 lines
Diff to previous 1.1 (colored)

Check strdup() return value, as pointed out by deraadt@

Revision 1.1 / (download) - annotate - [select for diffs], Thu Sep 25 19:32:44 2003 UTC (20 years, 7 months ago) by otto
Branch: MAIN

A new, BSD licensed implementation of bc(1).

ok deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.