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
commitde9068a389bb4f9dbd952abafbd63d90af463320 (patch)
tree78ca3b513d6d7e662117fc824c40f2db2b521b85 /expand.c
parent5b231449e7ec28efb834ef929b20198a13d8d2d4 (diff)
downloadmake-de9068a389bb4f9dbd952abafbd63d90af463320.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 4eabcc64..ba04e484 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. */