Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Mar 2016 17:24:03 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r296429 - head/bin/sh
Message-ID:  <201603061724.u26HO3K4060917@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Sun Mar  6 17:24:02 2016
New Revision: 296429
URL: https://svnweb.freebsd.org/changeset/base/296429

Log:
  sh: Fix some dead stores.
  
  Found by:	clang static analyzer

Modified:
  head/bin/sh/expand.c
  head/bin/sh/histedit.c

Modified: head/bin/sh/expand.c
==============================================================================
--- head/bin/sh/expand.c	Sun Mar  6 15:57:43 2016	(r296428)
+++ head/bin/sh/expand.c	Sun Mar  6 17:24:02 2016	(r296429)
@@ -463,7 +463,6 @@ expbackq(union node *cmd, int quoted, in
 	argbackq = saveargbackq;
 
 	p = in.buf;
-	lastc = '\0';
 	nnl = 0;
 	if (!quoted && flag & EXP_SPLIT)
 		ifs = ifsset() ? ifsval() : " \t\n";
@@ -1288,7 +1287,7 @@ patmatch(const char *pattern, const char
 				if (wc == 0)
 					goto backtrack;
 			} else
-				wc = (unsigned char)*q++;
+				q++;
 			break;
 		case '*':
 			c = *p;

Modified: head/bin/sh/histedit.c
==============================================================================
--- head/bin/sh/histedit.c	Sun Mar  6 15:57:43 2016	(r296428)
+++ head/bin/sh/histedit.c	Sun Mar  6 17:24:02 2016	(r296429)
@@ -359,7 +359,7 @@ histcmd(int argc, char **argv __unused)
 					 * cursor, set it back to the current
 					 * entry.
 					 */
-					retval = history(hist, &he,
+					history(hist, &he,
 					    H_NEXT_EVENT, oldhistnum);
 				}
 			} else



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603061724.u26HO3K4060917>