summaryrefslogtreecommitdiff
path: root/commands.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1992-06-03 01:17:16 +0000
committerRoland McGrath <roland@redhat.com>1992-06-03 01:17:16 +0000
commit343ac48a2d822aed13392edecb679cbd70f88374 (patch)
treef20cdb62f9aed086f1872708af0efaf979d8d679 /commands.c
parent85bab9477baab61c7d4b7eaaa111460967904cb4 (diff)
downloadgunmake-343ac48a2d822aed13392edecb679cbd70f88374.tar.gz
Formerly commands.c.~4~
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/commands.c b/commands.c
index 31f43ad..f6f292f 100644
--- a/commands.c
+++ b/commands.c
@@ -140,23 +140,33 @@ set_file_variables (file)
register char *qp, *qDp, *qFp;
register struct dep *d;
unsigned int len;
+ unsigned int caretD_len, qmarkD_len;
caret_len = qmark_len = 0;
+ caretD_len = qmarkD_len = 0;
for (d = file->deps; d != 0; d = d->next)
{
register unsigned int i = strlen (dep_name (d)) + 1;
caret_len += i;
+ caretD_len += (i <= 2 ? 3 : i);
if (d->changed)
+ {
qmark_len += i;
+ qmarkD_len += (i <= 2 ? 3 : i);
+ }
}
len = caret_len == 0 ? 1 : caret_len;
+ if (caretD_len == 0)
+ caretD_len = 1;
cp = caret_value = (char *) xmalloc (len);
- cDp = caretD_value = (char *) xmalloc (len);
+ cDp = caretD_value = (char *) xmalloc (caretD_len);
cFp = caretF_value = (char *) xmalloc (len);
len = qmark_len == 0 ? 1 : qmark_len;
+ if (qmarkD_len == 0)
+ qmarkD_len = 1;
qp = qmark_value = (char *) xmalloc (len);
- qDp = qmarkD_value = (char *) xmalloc (len);
+ qDp = qmarkD_value = (char *) xmalloc (qmarkD_len);
qFp = qmarkF_value = (char *) xmalloc (len);
for (d = file->deps; d != 0; d = d->next)