summaryrefslogtreecommitdiff
path: root/expand.c
diff options
context:
space:
mode:
Diffstat (limited to 'expand.c')
-rw-r--r--expand.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/expand.c b/expand.c
index 4aadb26..cc8ede4 100644
--- a/expand.c
+++ b/expand.c
@@ -360,7 +360,9 @@ variable_expand_string (char *line, const char *string, long length)
if (ppercent)
{
++ppercent;
- rpercent = 0;
+ rpercent = find_percent (replace);
+ if (rpercent)
+ ++rpercent;
}
else
{
@@ -370,8 +372,8 @@ variable_expand_string (char *line, const char *string, long length)
--replace;
}
- o = patsubst_expand (o, value, pattern, replace,
- ppercent, rpercent);
+ o = patsubst_expand_pat (o, value, pattern, replace,
+ ppercent, rpercent);
if (v->recursive)
free (value);