diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2003-11-13 19:42:22 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2003-11-13 19:42:22 +0000 |
commit | 9306ee40880e21bb8bb85e7fe9a38b878f4e67af (patch) | |
tree | 2b14f24c1369f59291a17f504c5b43c46e55f496 /usr.bin/bc | |
parent | 730d32cc92b0304e19f1a422a0e8144a96a59e34 (diff) |
When using print, do not leave garbage on the dc stack.
Diffstat (limited to 'usr.bin/bc')
-rw-r--r-- | usr.bin/bc/bc.y | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/bc/bc.y b/usr.bin/bc/bc.y index 434ba262e02..b7646bdb5bb 100644 --- a/usr.bin/bc/bc.y +++ b/usr.bin/bc/bc.y @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: bc.y,v 1.17 2003/11/13 19:05:32 otto Exp $ */ +/* $OpenBSD: bc.y,v 1.18 2003/11/13 19:42:21 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek <otto@drijf.net> @@ -31,7 +31,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: bc.y,v 1.17 2003/11/13 19:05:32 otto Exp $"; +static const char rcsid[] = "$OpenBSD: bc.y,v 1.18 2003/11/13 19:42:21 otto Exp $"; #endif /* not lint */ #include <ctype.h> @@ -656,13 +656,12 @@ print_expression_list print_expression : expression { - $$ = node($1, cs("dds.n"), END_NODE); + $$ = node($1, cs("ds.n"), END_NODE); } | STRING { char *p = escape($1); - $$ = node(cs("["), as(p), cs("]dn"), - END_NODE); + $$ = node(cs("["), as(p), cs("]n"), END_NODE); free(p); } %% |