From 0799ce730d2404d1cd1d03ce2f4ac07cc079c72e Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Tue, 21 Sep 2004 04:00:31 +0000 Subject: Fix some bugs in variable pattern substitution (e.g. $(VAR:A=B)), reported by Markus Mauhart . One was a simple typo; to fix the other we call patsubst_expand() for all instances of variable substitution, even when there is no '%'. We used to call subst_expand() with a special flag set in the latter case, but it didn't work properly in all situations. Easier to just use patsubst_expand() since that's what it is. --- read.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'read.c') diff --git a/read.c b/read.c index e2ad630..fc69a8e 100644 --- a/read.c +++ b/read.c @@ -1861,7 +1861,7 @@ record_files (struct nameseq *filenames, char *pattern, char *pattern_percent, if (percent == 0) continue; o = patsubst_expand (buffer, name, pattern, d->name, - pattern_percent, percent); + pattern_percent+1, percent+1); /* If the name expanded to the empty string, that's illegal. */ if (o == buffer) @@ -2067,7 +2067,7 @@ record_files (struct nameseq *filenames, char *pattern, char *pattern_percent, static char *percent = "%"; char *buffer = variable_expand (""); char *o = patsubst_expand (buffer, name, pattern, percent, - pattern_percent, percent); + pattern_percent+1, percent+1); f->stem = savestring (buffer, o - buffer); } } -- cgit v1.2.3