[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: system.h cleanups

From: Jim Meyering
Subject: Re: system.h cleanups
Date: Thu, 08 Oct 2009 18:16:40 +0200

Eric Blake wrote:
> Jim Meyering <jim <at> meyering.net> writes:
>> ??  As far as I can see, one cannot remove ASSIGN_STRDUPA,
>> since it is not defined anyplace else.
>> The code (cp.c, df.c, copy.c) won't compile without it.
> Aargh.  Serves me right for deleting without testing.  I merely grepped for
> strdupa (no other uses) rather than ASSIGN_STRDUPA.  I've reverted that 
> portion
> of the patch.  Although there's still the issue that ASSIGN_STRDUPA can cause
> stack overflow if used on arbitrarily long names; maybe it's worth rewriting
> these interfaces to use Bruno's malloca interfaces (alloca for short lengths,
> but malloc for long; requires adding a cleanup call, but still provides speed
> in the common case of short strings).

IMHO, it's not worth trying to avoid uses of ASSIGN_STRDUPA
in cp.c and copy.c, since it's already limited by PATH_MAX.
And once cp is rewritten to use fts and fd-relative names,
alloca-related limitations will be even less of a problem.
Though by then, the offending code will probably be gone.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]