summaryrefslogtreecommitdiff
path: root/expand.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-07-21 17:52:13 -0400
committerPaul Smith <psmith@gnu.org>2013-07-21 17:52:13 -0400
commit87ac68fe79a2e3b0d149135d40d8cbc5500024af (patch)
tree78ca3b513d6d7e662117fc824c40f2db2b521b85 /expand.c
parent72462ef1e181fc99837ba3077f9b5d192f16f6aa (diff)
downloadgunmake-87ac68fe79a2e3b0d149135d40d8cbc5500024af.tar.gz
[Bug #39158] Source cleanups suggested by cppcheck utility.
Diffstat (limited to 'expand.c')
-rw-r--r--expand.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/expand.c b/expand.c
index 4eabcc6..ba04e48 100644
--- a/expand.c
+++ b/expand.c
@@ -304,10 +304,8 @@ variable_expand_string (char *line, const char *string, long length)
if (colon)
{
/* This looks like a substitution reference: $(FOO:A=B). */
- const char *subst_beg, *subst_end, *replace_beg, *replace_end;
-
- subst_beg = colon + 1;
- subst_end = lindex (subst_beg, end, '=');
+ const char *subst_beg = colon + 1;
+ const char *subst_end = lindex (subst_beg, end, '=');
if (subst_end == 0)
/* There is no = in sight. Punt on the substitution
reference and treat this as a variable name containing
@@ -315,8 +313,8 @@ variable_expand_string (char *line, const char *string, long length)
colon = 0;
else
{
- replace_beg = subst_end + 1;
- replace_end = end;
+ const char *replace_beg = subst_end + 1;
+ const char *replace_end = end;
/* Extract the variable name before the colon
and look up that variable. */