This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: ar -M temporary file bug


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]