This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: ar -M temporary file bug
- To: Earl Chew <earl_chew at agilent dot com>
- Subject: Re: PATCH: ar -M temporary file bug
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 19 Oct 2001 21:47:31 +0200
- Cc: binutils at sources dot redhat dot com
- References: <3BD080E0.CF3DA9FB@agilent.com>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
On Fri, Oct 19, 2001 at 12:37:04PM -0700, Earl Chew wrote:
> This patch fixes a problem using ar -M. The command CREATE x/y.a fails
> in recent versions of ar. Previous versions would create a temporary
> file named x/y.a-tmp.
>
> This would fail on DOS file systems, so a later patch was made to
> instead use a tmp- prefix, instead of a -tmp suffix. This works
> for CREATE z.a. A temporary file named tmp-z.a being the result.
>
> This strategy fails for CREATE x/y.a since it attempts to create
> a temporary file named tmp-x/y.a.
>
> This patch applies the tmp- prefix to the basename, rather than
> the entire pathname. Thus CREATE x/y.a results in the temporary
> file named x/tmp-y.a.
>
> The patch accommodates / and \ path separators, and a corresponding
> change to the definition of FILENAME is necessary to allow
> DOS \ path separators to be parsed.
Please see http://sources.redhat.com/ml/binutils/2001-10/msg00337.html
The arlex.l change is still needed.
Your patch will not handle properly D:foo.a on DOS filesystems btw, if
temporary filename really needs to ressemble created archive name, it should
use lbasename.
>
> * arsup.h (ar_open): Create temporary filename by prepending
> tmp- to the basename, rather than the entire pathname.
> * arlex.l: Extend FILENAME definition to allow for DOS
> path separators.
>
Jakub