From 87ac68fe79a2e3b0d149135d40d8cbc5500024af Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 21 Jul 2013 17:52:13 -0400 Subject: [Bug #39158] Source cleanups suggested by cppcheck utility. --- expand.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'expand.c') 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. */ -- cgit v1.2.3