Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Sep 1995 03:08:46 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bugs@freebsd.org, mikebo@tellab5
Subject:   Re: 2.0.5R: Is there a BUG in "ar"?
Message-ID:  <199509181708.DAA01181@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
># ar x ../libc_pic.a
>ar: ../libc_pic.a: Inappropriate file type or format

`ar x' always fails on filenames with odd lengths >= 17.  Try this fix.

*** archive.c~	Wed May 31 19:51:24 1995
--- archive.c	Sat Sep 16 02:27:28 1995
***************
*** 277,281 ****
  	off_t size;
  {
- 	int pad_odd_read;
  	static char pad = '\n';
  	off_t sz;
--- 277,280 ----
***************
*** 301,310 ****
  	}
  
! 	if (already_written)
! 		pad_odd_read = (cfp->flags & RPAD) && ((size + chdr.lname) & 1);
! 	else
! 		pad_odd_read = (cfp->flags & RPAD) && (size & 1);
! 
! 	if (pad_odd_read && (nr = read(from, buf, 1)) != 1) {
  		if (nr == 0)
  			badfmt();
--- 300,305 ----
  	}
  
! 	if (cfp->flags & RPAD && (size + chdr.lname) & 1 &&
! 	    (nr = read(from, buf, 1)) != 1) {
  		if (nr == 0)
  			badfmt();

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509181708.DAA01181>