svn commit: r203438 - head/usr.bin/dc

Gabor Kovesdan gabor at FreeBSD.org
Wed Feb 3 19:13:42 UTC 2010


Author: gabor
Date: Wed Feb  3 19:13:41 2010
New Revision: 203438
URL: http://svn.freebsd.org/changeset/base/203438

Log:
  - Remove dead variable assignments
  - Fix -x
  
  Submitted by:	uqs
  Approved by:	delphij (mentor)

Modified:
  head/usr.bin/dc/bcode.c
  head/usr.bin/dc/dc.c

Modified: head/usr.bin/dc/bcode.c
==============================================================================
--- head/usr.bin/dc/bcode.c	Wed Feb  3 19:12:27 2010	(r203437)
+++ head/usr.bin/dc/bcode.c	Wed Feb  3 19:13:41 2010	(r203438)
@@ -1620,11 +1620,9 @@ skipN(void)
 static void
 skip_until_mark(void)
 {
-	int	 ch;
 
 	for (;;) {
-		ch = readch();
-		switch (ch) {
+		switch (readch()) {
 		case 'M':
 			return;
 		case EOF:
@@ -1649,7 +1647,7 @@ skip_until_mark(void)
 			free(read_string(&bmachine.readstack[bmachine.readsp]));
 			break;
 		case '!':
-			switch (ch = readch()) {
+			switch (readch()) {
 				case '<':
 				case '>':
 				case '=':

Modified: head/usr.bin/dc/dc.c
==============================================================================
--- head/usr.bin/dc/dc.c	Wed Feb  3 19:12:27 2010	(r203437)
+++ head/usr.bin/dc/dc.c	Wed Feb  3 19:13:41 2010	(r203438)
@@ -82,16 +82,8 @@ main(int argc, char *argv[])
 {
 	int		 ch;
 	bool		 extended_regs = false;
-	char		*buf;
 	bool		 preproc_done = false;
 
-	if ((buf = strdup("")) == NULL)
-		err(1, NULL);
-
-	init_bmachine(extended_regs);
-	setlinebuf(stdout);
-	setlinebuf(stderr);
-
 	/* accept and ignore a single dash to be 4.4BSD dc(1) compatible */
 	while ((ch = getopt_long(argc, argv, "e:f:Vx", long_options, NULL)) != -1) {
 		switch (ch) {
@@ -123,6 +115,10 @@ main(int argc, char *argv[])
 	argc -= optind;
 	argv += optind;
 
+	init_bmachine(extended_regs);
+	setlinebuf(stdout);
+	setlinebuf(stderr);
+
 	if (argc > 1)
 		usage();
 	if (argc == 1) {


More information about the svn-src-all mailing list