bug-coreutils
[Top][All Lists]
Advanced

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

Re: ln.c portability fix for hosts where / != //


From: Jim Meyering
Subject: Re: ln.c portability fix for hosts where / != //
Date: Fri, 04 Nov 2005 16:50:40 +0100

Eric Blake <address@hidden> wrote:
...
>>  /* Construct a string NEW_DEST by concatenating DEST, a slash, and
>> -   basename(SOURCE) in alloca'd memory.  Don't modify DEST or SOURCE.  */
>> +   basename (SOURCE) in alloca'd memory.  Don't modify DEST or SOURCE.
>> +   Omit unnecessary slashes in the boundary between DEST and SOURCE in
>> +   the result; they can cause harm if "/" and "//" denote different
>> +   directories.  */
>>
>>  #define FILE_BASENAME_CONCAT(new_dest, dest, source)                        
>> \
>
> Why not fix this to malloc instead of alloca, since on platforms (like
> Hurd) that accept arbitrarily long filenames, alloca will cause problems
> on long names?

IMHO, it's not worth it, since the only use is to concatenate
the destination directory and the basename of a source file name,
both of which were specified on the command line.

But if someone submits a clean patch, I'll consider it.




reply via email to

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