summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
Diffstat (limited to 'read.c')
-rw-r--r--read.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/read.c b/read.c
index 65a352f..0f07ee9 100644
--- a/read.c
+++ b/read.c
@@ -2106,18 +2106,6 @@ record_files (struct nameseq *filenames, char *pattern, char *pattern_percent,
if (cmds != 0)
f->updating = 1;
}
-
- /* If this is a static pattern rule, set the file's stem to
- the part of its name that matched the `%' in the pattern,
- so you can use $* in the commands. */
- if (pattern != 0)
- {
- static char *percent = "%";
- char *buffer = variable_expand ("");
- char *o = patsubst_expand (buffer, name, pattern, percent,
- pattern_percent+1, percent+1);
- f->stem = savestring (buffer, o - buffer);
- }
}
else
{
@@ -2143,6 +2131,18 @@ record_files (struct nameseq *filenames, char *pattern, char *pattern_percent,
f->cmds = cmds;
}
+ /* If this is a static pattern rule, set the file's stem to
+ the part of its name that matched the `%' in the pattern,
+ so you can use $* in the commands. */
+ if (pattern != 0)
+ {
+ static char *percent = "%";
+ char *buffer = variable_expand ("");
+ char *o = patsubst_expand (buffer, name, pattern, percent,
+ pattern_percent+1, percent+1);
+ f->stem = savestring (buffer, o - buffer);
+ }
+
/* Free name if not needed further. */
if (f != 0 && name != f->name
&& (name < f->name || name > f->name + strlen (f->name)))