summaryrefslogtreecommitdiff
path: root/rule.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1993-10-21 20:48:08 +0000
committerRoland McGrath <roland@redhat.com>1993-10-21 20:48:08 +0000
commit0ddf76156370612c23b50d69b8c75299be56d8eb (patch)
tree37713a602157039159c8dd1a3b706d49b8e96033 /rule.c
parent58d81fe699bcb465b36ff479cc5f74565da4811b (diff)
downloadgunmake-0ddf76156370612c23b50d69b8c75299be56d8eb.tar.gz
entered into RCS
Diffstat (limited to 'rule.c')
-rw-r--r--rule.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/rule.c b/rule.c
index 98d7010..b69212d 100644
--- a/rule.c
+++ b/rule.c
@@ -164,7 +164,7 @@ convert_suffix_rule (target, source, cmds)
char *target, *source;
struct commands *cmds;
{
- char *targname, *depname;
+ char *targname, *targpercent, *depname;
char **names, **percents;
struct dep *deps;
unsigned int len;
@@ -172,7 +172,10 @@ convert_suffix_rule (target, source, cmds)
if (target == 0)
/* Special case: TARGET being nil means we are defining a
`.X.a' suffix rule; the target pattern is always `(%.o)'. */
- targname = savestring ("(%.o)", 5);
+ {
+ targname = savestring ("(%.o)", 5);
+ targpercent = targname + 1;
+ }
else
{
/* Construct the target name. */
@@ -180,11 +183,13 @@ convert_suffix_rule (target, source, cmds)
targname = xmalloc (1 + len + 1);
targname[0] = '%';
bcopy (target, targname + 1, len + 1);
+ targpercent = targname;
}
names = (char **) xmalloc (2 * sizeof (char *));
percents = (char **) alloca (2 * sizeof (char *));
- names[0] = percents[0] = targname;
+ names[0] = targname;
+ percents[0] = targpercent;
names[1] = percents[1] = 0;
if (source == 0)