From b50f2fc0a61c0d3719c9acbbb413d8340ed2de7e Mon Sep 17 00:00:00 2001
From: Roland McGrath <roland@redhat.com>
Date: Sun, 21 Feb 1993 20:05:54 +0000
Subject: [PATCH] Formerly commands.c.~17~

---
 commands.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/commands.c b/commands.c
index 5b8975fa..07729465 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.  */