summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2004-09-21 04:00:31 +0000
committerPaul Smith <psmith@gnu.org>2004-09-21 04:00:31 +0000
commit0799ce730d2404d1cd1d03ce2f4ac07cc079c72e (patch)
tree6b9602199bec0f905f06a7a8f1c7bedb1e65b349 /read.c
parent08c8105c5468ff743d2f2ff2fdf3b77a6313b53e (diff)
downloadgunmake-0799ce730d2404d1cd1d03ce2f4ac07cc079c72e.tar.gz
Fix some bugs in variable pattern substitution (e.g. $(VAR:A=B)),
reported by Markus Mauhart <qwe123@chello.at>. 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.
Diffstat (limited to 'read.c')
-rw-r--r--read.c4
1 files changed, 2 insertions, 2 deletions
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);
}
}