summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1993-02-21 20:05:54 +0000
committerRoland McGrath <roland@redhat.com>1993-02-21 20:05:54 +0000
commitb50f2fc0a61c0d3719c9acbbb413d8340ed2de7e (patch)
treecf37900f2cf1030f7dcfde8395dfe5b78ea5000a
parent4034f2bdfbc61a38c4ef4669e30d2757c7f08d33 (diff)
downloadgunmake-b50f2fc0a61c0d3719c9acbbb413d8340ed2de7e.tar.gz
Formerly commands.c.~17~
-rw-r--r--commands.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/commands.c b/commands.c
index 5b8975f..0772946 100644
--- a/commands.c
+++ b/commands.c
@@ -44,11 +44,15 @@ set_file_variables (file)
if (ar_name (file->name))
{
+ unsigned int len;
p = index (file->name, '(');
at = (char *) alloca (p - file->name + 1);
bcopy (file->name, at, p - file->name);
at[p - file->name] = '\0';
- percent = p + 1;
+ len = strlen (p + 1);
+ percent = (char *) alloca (len);
+ bcopy (p + 1, percent, len - 1);
+ percent[len - 1] = '\0';
}
else
#endif /* NO_ARCHIVES. */