Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37836216
en ru br
ALT Linux repos
S:1.07.1-alt1
5.0: 1.06-alt2
4.1: 1.06-alt2
4.0: 1.06-alt2
3.0: 1.06-ipl6mdk

Group :: Sciences/Mathematics
RPM: bc

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: bc-1.06-deb-17.patch
Download


--- bc-1.06.orig/configure.in
+++ bc-1.06/configure.in
@@ -9,6 +9,8 @@
 AC_DEFINE_UNQUOTED(DC_COPYRIGHT, dnl
  ["Copyright 1994, 1997, 1998, 2000 Free Software Foundation, Inc."])
 
+AM_MAINTAINER_MODE
+
 AC_PROG_CC
 AC_MINIX
 dnl AC_ISC_POSIX
@@ -68,7 +70,7 @@
 ])
 
 if test "$LEX" = "flex" ; then
- LEX="flex -I8"
+ LEX="flex -I -8"
 else
  if test "$bcrl" = "y" ; then
   AC_MSG_WARN(readline works only with flex.)
@@ -85,5 +87,4 @@
 fi
 
 AC_SUBST(READLINELIB)
-AC_ARG_PROGRAM
 AC_OUTPUT(Makefile bc/Makefile dc/Makefile doc/Makefile lib/Makefile)
--- bc-1.06.orig/lib/Makefile.am
+++ bc-1.06/lib/Makefile.am
@@ -7,7 +7,7 @@
 
 DEFS = @DEFS@ $(DEFSADD)
 
-CFLAGS = @CFLAGS@ -Wall -funsigned-char
+AM_CFLAGS = @CFLAGS@ -Wall -funsigned-char
 
 MAINTAINERCLEANFILES = Makefile.in number.c
 
--- bc-1.06.orig/bc/Makefile.am
+++ bc-1.06/bc/Makefile.am
@@ -16,9 +16,9 @@
 LIBL = @LEXLIB@
 LDADD = $(LIBBC) $(LIBL) @READLINELIB@
 
-YFLAGS = -d
+AM_YFLAGS = -d
 
-CFLAGS = @CFLAGS@ -Wall -funsigned-char
+AM_CFLAGS = @CFLAGS@ -Wall -funsigned-char
 
 $(PROGRAMS): $(LIBBC)
 
--- bc-1.06.orig/bc/main.c
+++ bc-1.06/bc/main.c
@@ -63,7 +63,7 @@
   printf ("usage: %s [options] [file ...]\n%s%s%s%s%s%s%s", progname,
           "  -h  --help         print this usage and exit\n",
 	  "  -i  --interactive  force interactive mode\n",
-	  "  -l  --mathlib      use the predefine math routnes\n",
+          "  -l  --mathlib      use the predefined math routines\n",
 	  "  -q  --quiet        don't print initial banner\n",
 	  "  -s  --standard     non-standard bc constructs are errors\n",
 	  "  -w  --warn         warn about non-standard bc constructs\n",
@@ -93,6 +93,9 @@
 
       switch (optch)
 	{
+	case 0: /* Long option setting a var. */
+	  break;
+
 	case 'c':  /* compile only */
 	  compile_only = TRUE;
 	  break;
--- bc-1.06.orig/bc/bc.y
+++ bc-1.06/bc/bc.y
@@ -79,7 +79,7 @@
 /*     'scale', 'ibase', 'obase', 'auto', 'read' 	*/
 %token <i_value> Scale    Ibase    Obase    Auto  Read
 /*     'warranty', 'halt', 'last', 'continue', 'print', 'limits'   */
-%token <i_value> Warranty, Halt, Last, Continue, Print, Limits
+%token <i_value> Warranty Halt Last Continue Print Limits
 /*     'history' */
 %token <i_value> UNARY_MINUS HistoryVar
 
@@ -203,7 +203,7 @@
 			    {
 			      if ($4 & 2)
 				warn ("Comparison in first for expression");
-			      if ($4 >= 0)
+			      if ($4 <= 0)
 				generate ("p");
 			      $4 = next_label++;
 			      sprintf (genstr, "N%1d:", $4);
@@ -211,7 +211,7 @@
 			    }
 			  opt_expression ';'
 			    {
-			      if ($7 < 0) generate ("1");
+			      if ($7 &16 ) generate ("1");
 			      $7 = next_label++;
 			      sprintf (genstr, "B%1d:J%1d:", $7, break_label);
 			      generate (genstr);
@@ -424,7 +424,6 @@
 			      generate (genstr);
 			      $$ = 0;
 			    }
-			;
 			| expression AND 
 			    {
 			      warn("&& operator");
--- bc-1.06.orig/dc/Makefile.am
+++ bc-1.06/dc/Makefile.am
@@ -9,6 +9,6 @@
 
 MAINTAINERCLEANFILES = Makefile.in
 
-CFLAGS = @CFLAGS@ -Wall -funsigned-char
+AM_CFLAGS = @CFLAGS@ -Wall -funsigned-char
 
 $(PROGRAMS): $(LDADD)
--- bc-1.06.orig/dc/dc.c
+++ bc-1.06/dc/dc.c
@@ -1,7 +1,7 @@
 /* 
  * implement the "dc" Desk Calculator language.
  *
- * Copyright (C) 1994, 1997, 1998, 2000 Free Software Foundation, Inc.
+ * Copyright (C) 1994, 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -41,6 +41,8 @@
 # endif
 #endif
 #include <getopt.h>
+#include <pwd.h>
+#include <unistd.h>
 #include "dc.h"
 #include "dc-proto.h"
 
@@ -77,6 +79,7 @@
 	fprintf(f, "\
 Usage: %s [OPTION] [file ...]\n\
   -e, --expression=EXPR    evaluate expression\n\
+  -E, --initexpr=EXPR      evaluate expression and continue\n\
   -f, --file=FILE          evaluate contents of file\n\
   -h, --help               display this help and exit\n\
   -V, --version            output version information and exit\n\
@@ -118,6 +121,29 @@
 		fclose(input);
 }
 
+static void
+try_rcfile(void)
+{
+    char *homedir;
+    struct passwd *pw;
+    char *rcfile;
+    FILE *input;
+
+    homedir=getenv("HOME");
+    if (!homedir)
+    {
+       pw=getpwuid(getuid());
+       homedir=pw->pw_dir;
+    }
+    rcfile=malloc(strlen(homedir)+8);
+    sprintf(rcfile, "%s/.dcrc", homedir);
+    if (!(input=fopen(rcfile, "r")))
+       return;
+    if (dc_evalfile(input))
+       exit(EXIT_FAILURE);
+    fclose(input);
+}
+
 
 int
 main DC_DECLARG((argc, argv))
@@ -129,6 +155,7 @@
 		{"file", required_argument, NULL, 'f'},
 		{"help", no_argument, NULL, 'h'},
 		{"version", no_argument, NULL, 'V'},
+                {"initexpr", required_argument, NULL, 'E'},
 		{NULL, 0, NULL, 0}
 	};
 	int did_eval = 0;
@@ -144,16 +171,23 @@
 	dc_register_init();
 	dc_array_init();
 
-	while ((c = getopt_long(argc, argv, "hVe:f:", long_opts, (int *)0)) != EOF) {
+	while ((c = getopt_long(argc, argv, "hVe:f:E:", long_opts, (int *)0)) !=+EOF) {
 		switch (c) {
 		case 'e':
 			{	dc_data string = dc_makestring(optarg, strlen(optarg));
-				if (dc_evalstr(string))
+				if (dc_evalstr(&string))
 					return EXIT_SUCCESS;
 				dc_free_str(&string.v.string);
 				did_eval = 1;
 			}
 			break;
+		case 'E':
+			{	
+			        dc_data string = dc_makestring(optarg, strlen(optarg));
+			        dc_evalstr(&string);
+				dc_free_str(&string.v.string);
+			}
+			break;
 		case 'f':
 			try_file(optarg);
 			did_eval = 1;
@@ -169,6 +203,8 @@
 			return EXIT_FAILURE;
 		}
 	}
+	
+	try_rcfile();
 
 	for (; optind < argc; ++optind) {
 		try_file(argv[optind]);
--- bc-1.06.orig/dc/eval.c
+++ bc-1.06/dc/eval.c
@@ -1,7 +1,7 @@
 /* 
  * evaluate the dc language, from a FILE* or a string
  *
- * Copyright (C) 1994, 1997, 1998, 2000 Free Software Foundation, Inc.
+ * Copyright (C) 1994, 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -55,6 +55,7 @@
 	DC_SYSTEM,		/* caller needs to run a system() on next input line */
 	DC_COMMENT,		/* caller needs to skip to the next input line */
 	DC_NEGCMP,		/* caller needs to re-call dc_func() with `negcmp' set */
+	DC_EVALREG,		/* caller needs to eval the string named by `peekc' */
 
 	DC_EOF_ERROR	/* unexpected end of input; abort current eval */
 } dc_status;
@@ -116,13 +117,13 @@
  */
 static int
 dc_eval_and_free_str DC_DECLARG((string))
-	dc_data string DC_DECLEND
+	dc_data *string DC_DECLEND
 {
 	dc_status status;
 
 	status = dc_evalstr(string);
-	if (string.dc_type == DC_STRING)
-		dc_free_str(&string.v.string);
+	if (string->dc_type == DC_STRING)
+		dc_free_str(&string->v.string);
 	return status;
 }
 
@@ -207,9 +208,7 @@
 		if (peekc == EOF)
 			return DC_EOF_ERROR;
 		if ( (dc_cmpop() <  0) == !negcmp )
-			if (dc_register_get(peekc, &datum) == DC_SUCCESS)
-				if (dc_eval_and_free_str(datum) == DC_QUIT)
-					return DC_QUIT;
+			return DC_EVALREG;
 		return DC_EATONE;
 	case '=':
 		/* eval register named by peekc if
@@ -218,9 +217,7 @@
 		if (peekc == EOF)
 			return DC_EOF_ERROR;
 		if ( (dc_cmpop() == 0) == !negcmp )
-			if (dc_register_get(peekc, &datum) == DC_SUCCESS)
-				if (dc_eval_and_free_str(datum) == DC_QUIT)
-					return DC_QUIT;
+			return DC_EVALREG;
 		return DC_EATONE;
 	case '>':
 		/* eval register named by peekc if
@@ -229,16 +226,15 @@
 		if (peekc == EOF)
 			return DC_EOF_ERROR;
 		if ( (dc_cmpop() >  0) == !negcmp )
-			if (dc_register_get(peekc, &datum) == DC_SUCCESS)
-				if (dc_eval_and_free_str(datum) == DC_QUIT)
-					return DC_QUIT;
+			return DC_EVALREG;
 		return DC_EATONE;
 	case '?':	/* read a line from standard-input and eval it */
 		if (stdin_lookahead != EOF){
 			ungetc(stdin_lookahead, stdin);
 			stdin_lookahead = EOF;
 		}
-		if (dc_eval_and_free_str(dc_readstring(stdin, '\n', '\n')) == DC_QUIT)
+		datum = dc_readstring(stdin, '\n', '\n');
+		if (dc_eval_and_free_str(&datum) == DC_QUIT)
 			return DC_QUIT;
 		return DC_OKAY;
 	case '[':	/* read to balancing ']' into a dc_str */
@@ -341,7 +337,7 @@
 		return DC_QUIT;
 	case 'r':	/* rotate (swap) the top two elements on the stack
 				 */
-		if (dc_pop(&datum) == DC_SUCCESS) {
+		if (dc_pop(&datum) == DC_SUCCESS){
 			dc_data datum2;
 			int two_status;
 			two_status = dc_pop(&datum2);
@@ -376,7 +372,7 @@
 	case 'x':	/* eval the datum popped from top of stack */
 		if (dc_pop(&datum) == DC_SUCCESS){
 			if (datum.dc_type == DC_STRING){
-				if (dc_eval_and_free_str(datum) == DC_QUIT)
+				if (dc_eval_and_free_str(&datum) == DC_QUIT)
 					return DC_QUIT;
 			}else if (datum.dc_type == DC_NUMBER){
 				dc_push(datum);
@@ -520,7 +516,7 @@
 /* takes a string and evals it */
 int
 dc_evalstr DC_DECLARG((string))
-	dc_data string DC_DECLEND
+	dc_data *string DC_DECLEND
 {
 	const char *s;
 	const char *end;
@@ -531,15 +527,16 @@
 	int count;
 	int negcmp;
 	int next_negcmp = 0;
+	int tail_depth = 1; /* how much tail recursion is active */
 
-	if (string.dc_type != DC_STRING){
+	if (string->dc_type != DC_STRING){
 		fprintf(stderr,
 				"%s: eval called with non-string argument\n",
 				progname);
 		return DC_OKAY;
 	}
-	s = dc_str2charp(string.v.string);
-	end = s + dc_strlen(string.v.string);
+	s = dc_str2charp(string->v.string);
+	end = s + dc_strlen(string->v.string);
 	while (s < end){
 		c = *(const unsigned char *)s++;
 		peekc = EOF;
@@ -555,8 +552,8 @@
 				++s;
 			break;
 		case DC_QUIT:
-			if (unwind_depth > 0){
-				--unwind_depth;
+			if (unwind_depth >= tail_depth){
+				unwind_depth -= tail_depth;
 				return DC_QUIT;
 			}
 			return DC_OKAY;
@@ -591,6 +588,36 @@
 		case DC_NEGCMP:
 			next_negcmp = 1;
 			break;
+		case DC_EVALREG:
+			if (peekc == EOF){
+				fprintf(stderr, "%s: unexpected EOS\n", progname);
+				return DC_OKAY;
+			}else{
+				dc_data evalstr;
+				++s;
+				if (dc_register_get(peekc, &evalstr) == DC_SUCCESS){
+					if (s == end){
+						if (evalstr.dc_type != DC_STRING){
+							fprintf(stderr,
+								"%s: eval called with non-string argument\n",
+								progname);
+							return DC_OKAY;
+						}
+						dc_free_str(&string->v.string);
+						*string = evalstr;
+						s = dc_str2charp(string->v.string);
+						end = s + dc_strlen(string->v.string);
+						++tail_depth;
+					}else if (dc_eval_and_free_str(&evalstr) == DC_QUIT){
+						if (unwind_depth > 0){
+							--unwind_depth;
+							return DC_QUIT;
+						}
+						return DC_OKAY;
+					}
+				}
+			}
+			break;
 
 		case DC_EOF_ERROR:
 			fprintf(stderr, "%s: unexpected EOS\n", progname);
@@ -672,6 +699,19 @@
 		case DC_NEGCMP:
 			next_negcmp = 1;
 			break;
+		case DC_EVALREG:
+			{
+				dc_data evalstr;
+				c = peekc;
+				peekc = getc(fp);
+				if (dc_register_get(c, &evalstr) == DC_SUCCESS &&
+							dc_eval_and_free_str(&evalstr) == DC_QUIT){
+					if (unwind_noexit != DC_TRUE)
+						return DC_SUCCESS;
+					fprintf(stderr, "%s: Q command argument exceeded string execution depth\n", progname);
+				}
+			}
+			break;
 
 		case DC_EOF_ERROR:
 			fprintf(stderr, "%s: unexpected EOF\n", progname);
@@ -680,3 +720,12 @@
 	}
 	return DC_SUCCESS;
 }
+
+
+/*
+  ! Local Variables: !
+  ! mode: C !
+  ! tab-width: 4 !
+  ! End: !
+  vi: ts=4 sw=4
+*/
--- bc-1.06.orig/dc/dc-proto.h
+++ bc-1.06/dc/dc-proto.h
@@ -1,7 +1,7 @@
 /*
  * prototypes of all externally visible dc functions
  * 
- * Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc.
+ * Copyright (C) 1994, 1997, 1998, 2003 Free Software Foundation, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -57,7 +57,7 @@
 extern int  dc_cmpop DC_PROTO((void));
 extern int  dc_compare DC_PROTO((dc_num, dc_num));
 extern int  dc_evalfile DC_PROTO((FILE *));
-extern int  dc_evalstr DC_PROTO((dc_data));
+extern int  dc_evalstr DC_PROTO((dc_data *));
 extern int  dc_num2int DC_PROTO((dc_num, dc_discard));
 extern int  dc_numlen DC_PROTO((dc_num));
 extern int  dc_pop DC_PROTO((dc_data *));
--- bc-1.06.orig/doc/dc.texi
+++ bc-1.06/doc/dc.texi
@@ -24,7 +24,7 @@
 @direntry
 * dc: (dc).                                     Arbitrary precision RPN ``Desktop Calculator''.
 @end direntry
-This file documents @sc{dc}, an arbitrary precision calculator.
+This file documents @command{dc}, an arbitrary precision calculator.
 
 Published by the Free Software Foundation, Inc.
 59 Temple Place, Suite 330
@@ -107,12 +107,12 @@
 @comment  node-name,  next,  previous,  up
 @chapter Introduction
 
-@sc{dc} is a reverse-polish desk calculator
+@command{dc} is a reverse-polish desk calculator
 which supports unlimited precision arithmetic.
 It also allows you to define and call macros.
-Normally @sc{dc} reads from the standard input;
+Normally @command{dc} reads from the standard input;
 if any command arguments are given to it, they are filenames,
-and @sc{dc} reads and executes the contents of the files
+and @command{dc} reads and executes the contents of the files
 instead of reading from standard input.
 All normal output is to standard output;
 all error messages are written to standard error.
@@ -126,7 +126,7 @@
 Entering a number pushes it on the stack.
 Arithmetic operations pop arguments off the stack and push the results.
 
-To enter a number in @sc{dc}, type the digits,
+To enter a number in @command{dc}, type the digits,
 with an optional decimal point.
 Exponential notation is not supported.
 To enter a negative number, begin the number with @samp{_}.
@@ -139,16 +139,16 @@
 @node Invocation, Printing Commands, Introduction, Top
 @chapter Invocation
 
-@sc{dc} may be invoked with the following command-line options:
+@command{dc} may be invoked with the following command-line options:
 @table @samp
 
 @item -e @var{expr}
 @item --expression=@var{expr}
-Evaluate @var{expr} as @sc{dc} commands.
+Evaluate @var{expr} as @command{dc} commands.
 
 @item -f @var{file}
 @item --file=@var{file}
-Read and evaluate @sc{dc} commands from @var{file}.
+Read and evaluate @command{dc} commands from @var{file}.
 
 @item -h
 @item --help
@@ -188,9 +188,15 @@
 Assuming that (UCHAR_MAX+1) is 256
 (as it is on most machines with 8-bit bytes),
 the sequence
-@code{KSK 0k1/ [_1*]sx d0>x [256~aPd0<x]dsxx sxLKk}
-could also accomplish this function,
-except for the side-effect of clobbering the x register.
+@code{KSK0k1/ _1Ss[ls*]Sxd0>x
+[256~Ssd0<x]dsxx
+sx[q]Sq[Lsd0>qaPlxx]dsxx
+sx0sqLqsxLxLK+k}
+could also accomplish this function.
+(Much of the complexity of the above native-dc code is due
+to the ~ computing the characters backwards,
+and the desire to ensure that all registers wind up back
+in their original states.)
 (Details of the behavior with a number are a GNU extension.)
 
 @item f
@@ -266,7 +272,8 @@
 The third value popped is the base which gets exponentiated,
 which should be an integer.
 For small integers this is like the sequence @code{Sm^Lm%},
-but, unlike @code{^}, this command will work with arbritrarily large exponents.
+but, unlike @code{^},
+this command will work with arbritrarily large exponents.
 (This command is a GNU extension.)
 
 @item v
@@ -295,13 +302,17 @@
 
 @item r
 Reverses the order of (swaps) the top two values on the stack.
+(This can also be accomplished with the sequence @code{SaSbLaLb}.)
 (This command is a GNU extension.)
 @end table
 
 @node Registers, Parameters, Stack Control, Top
 @chapter Registers
 
-@sc{dc} provides at least 256 memory registers,
+@command{dc} provides at least 256 memory registers@footnote{The
+exact number of registers provided by @command{dc} depends
+on the range of an @code{unsigned char} in the C compiler
+used to create the @command{dc} executable.},
 each named by a single character.
 You can store a number in a register and retrieve it later.
 
@@ -338,7 +349,7 @@
 @node Parameters, Strings, Registers, Top
 @chapter Parameters
 
-@sc{dc} has three parameters that control its operation:
+@command{dc} has three parameters that control its operation:
 the precision, the input radix, and the output radix.
 The precision specifies the number of fraction digits
 to keep in the result of most arithmetic operations.
@@ -381,12 +392,15 @@
 @node Strings, Status Inquiry, Parameters, Top
 @chapter Strings
 
-@sc{dc} can operate on strings as well as on numbers.
-The only things you can do with strings are print them
+@command{dc} has a limited ability
+to operate on strings as well as on numbers;
+the only things you can do with strings are print them
 and execute them as macros
-(which means that the contents of the string are processed as @sc{dc} commands).
+(which means that the contents of the string are processed
+as @command{dc} commands).
 Both registers and the stack can hold strings,
-and @sc{dc} always knows whether any given object is a string or a number.
+and @command{dc} always knows whether any given object is
+a string or a number.
 Some commands such as arithmetic operations demand numbers
 as arguments and print errors if given strings.
 Other commands can accept either a number or a string;
@@ -398,12 +412,15 @@
 Makes a string containing @var{characters} and pushes it on the stack.
 For example, @samp{[foo]P} prints the characters @samp{foo}
 (with no newline).
+Note that all square brackets (@samp{[}s and @samp{]}s) must be balanced;
+there is no mechanism provided for handling unbalanced square brackets.
 
 @item a
 The mnemonic for this is somewhat erroneous: asciify.
 The top-of-stack is popped.
 If it was a number, then the low-order byte of this number
-is converted into a string and pushed onto the stack.
+is converted into a 1-character string
+and pushed onto the stack.
 Otherwise the top-of-stack was a string,
 and the first character of that string is pushed back.
 (This command is a GNU extension.)
@@ -455,7 +472,7 @@
 this command exits from the macro and also from the macro which invoked it.
 If called from the top level,
 or from a macro which was called directly from the top level,
-the @samp{q} command will cause @sc{dc} to exit.
+the @samp{q} command will cause @command{dc} to exit.
 
 @item Q
 Pops a value off the stack and uses it as a count
--- bc-1.06.orig/doc/bc.1
+++ bc-1.06/doc/bc.1
@@ -207,7 +207,7 @@
 the "var" part is evaluated only once.  This can make a difference if
 "var" is an array.
 .PP
- Relational expressions are a special kind of expression
+Relational expressions are a special kind of expression
 that always evaluate to 0 or 1, 0 if the relation is false and 1 if
 the relation is true.  These may appear in any legal expression.
 (POSIX bc requires that relational expressions are used only in if,
@@ -639,7 +639,7 @@
 extensions, where a feature is extended to add more functionality and
 additions, where new features are added. 
 The following is the list of differences and extensions.
-.IP LANG environment
+.IP "LANG environment"
 This version does not conform to the POSIX standard in the processing
 of the LANG environment variable and all environment variables starting
 with LC_.
--- bc-1.06.orig/doc/dc.1
+++ bc-1.06/doc/dc.1
@@ -2,7 +2,7 @@
 .\" dc.1 - the *roff document processor source for the dc manual
 .\"
 .\" This file is part of GNU dc.
-.\" Copyright (C) 1994, 1997, 1998, 2000 Free Software Foundation, Inc.
+.\" Copyright (C) 1994, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
 .\"
 .\" This program is free software; you can redistribute it and/or modify
 .\" it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
 .\"   59 Temple Place, Suite 330
 .\"   Boston, MA 02111 USA
 .\"
-.TH DC 1 "1997-03-25" "GNU Project"
+.TH DC 1 "2001-05-13" "GNU Project"
 .ds dc \fIdc\fP
 .ds Dc \fIDc\fP
 .SH NAME
@@ -28,6 +28,7 @@
 .SH SYNOPSIS
 dc [-V] [--version] [-h] [--help]
    [-e scriptexpression] [--expression=scriptexpression]
+   [-E scriptexpression] [--initexpr=scriptexpression]
    [-f scriptfile] [--file=scriptfile]
    [file ...]
 .SH DESCRIPTION
@@ -79,6 +80,13 @@
 Add the commands in
 .I script
 to the set of commands to be run while processing the input.
+.B -E \fIscript\fP
+.TP
+.BI --initexpr= script
+Add the commands in
+.I script
+to the set of commands to be run while processing the input, but unlike
+-e, execute stdin if no other files specified.
 .TP
 .B -f \fIscript-file\fP
 .TP
@@ -93,7 +101,8 @@
 A file name of
 .B -
 refers to the standard input stream.
-The standard input will processed if no file names are specified.
+The standard input will processed if no script files or
+expressions are specified.
 .PD
 .SH
 Printing Commands
@@ -114,9 +123,14 @@
 value is printed out as a "base (UCHAR_MAX+1)" byte stream.
 Assuming that (UCHAR_MAX+1) is 256
 (as it is on most machines with 8-bit bytes),
-the sequence \fBKSK 0k1/ [_1*]sx d0>x [256~aPd0<x]dsxx sxLKk\fP
-could also accomplish this function,
-except for the side-effect of clobbering the x register.
+the sequence \fBKSK0k1/_1Ss [ls*]Sxd0>x
+[256~Ssd0<x]dsxxsx[q]Sq[Lsd0>qaPlxx]
+dsxxsx0sqLqsxLxLK+k\fP
+could also accomplish this function.
+(Much of the complexity of the above native-dc code is due
+to the ~ computing the characters backwards,
+and the desire to ensure that all registers wind up back
+in their original states.)
 .TP
 .B f
 Prints the entire contents of the stack
@@ -219,6 +233,7 @@
 .TP
 .B r
 Reverses the order of (swaps) the top two values on the stack.
+(This can also be accomplished with the sequence \fBSaSbLaLb\fP.)
 .SH
 Registers
 .PP
@@ -311,8 +326,9 @@
 .SH
 Strings
 .PP
-\*(Dc can operate on strings as well as on numbers.
-The only things you can do with strings are
+\*(Dc has a limited ability to operate on strings
+as well as on numbers;
+the only things you can do with strings are
 print them and execute them as macros
 (which means that the contents of the string are processed as
 \*(dc commands).
@@ -482,6 +498,14 @@
 because the 2 was stored in an instance of 0:a that
 was later popped.
 .SH
+FILES
+.TP 15
+~/.dcrc
+The commands in this file will be executed when
+.I dc
+is first run.
+.PP
+.SH
 BUGS
 .PP
 Email bug reports to
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin