* archive.c (bfd_dont_truncate_arname): Add the ar padding
authorIan Lance Taylor <ian@airs.com>
Mon, 31 Oct 1994 20:23:47 +0000 (20:23 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 31 Oct 1994 20:23:47 +0000 (20:23 +0000)
character, if there is room for it, even if the name is the
maximum length.
PR 5859.

bfd/ChangeLog
bfd/archive.c

index 1f7204c40177c69bac5e78ccd6755a65f99a9769..c88d1bd96decf4e0d68a1cb94c1979d5f8409c51 100644 (file)
@@ -1,5 +1,9 @@
 Mon Oct 31 14:19:08 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
 
+       * archive.c (bfd_dont_truncate_arname): Add the ar padding
+       character, if there is room for it, even if the name is the
+       maximum length.
+
        * elfcode.h (assign_file_positions_except_relocs): Sort the ELF
        headers by section address when assigning file positions.
        (elf_sort_hdrs): New static function.
index 090c141fe739361ff464f641c3ac92f9da39fd02..a968dd5d855499de1ca90e7a29274093f66c84d1 100644 (file)
@@ -1412,7 +1412,9 @@ bfd_dont_truncate_arname (abfd, pathname, arhdr)
   if (length <= maxlen)
     memcpy (hdr->ar_name, filename, length);
 
-  if (length < maxlen)
+  /* Add the padding character if there is room for it.  */
+  if (length < maxlen
+      || (length == maxlen && length < sizeof hdr->ar_name))
     (hdr->ar_name)[length] = ar_padchar (abfd);
 }
 
This page took 0.029214 seconds and 4 git commands to generate.