rewriting config_*, xmalloc_fget*

Timo Teräs timo.teras at iki.fi
Thu Jun 16 14:41:59 UTC 2011


On 06/16/2011 04:53 PM, Nuno Lucas wrote:
> On 06/16/2011 05:51 AM, Timo Teräs wrote:
>> Notably, though, at least sed.c seems to rely on the fact that \n and \0
>> are both recognized, and jumps through many hoops to handle them both
>> properly. Apparently there's out some sed scripts that use both \n and
>> \0 as statement separator, but they have different meaning.
>>
>> Not sure if there's other applets relying on this.
>>
>> But just like I told before, this also reason why the API needs rewrite,
>> it should *not* treat both as line separators, unless there's some
>> explicit need.
> 
> See, e.g, the -print0 parameter in "find".
> 
> It is an old method to handle paths with spaces on them.
> Some old programs treated all white space (including newline) as file
> separators, so when spaces could be in paths something needed to be done
> to handle them by programs like, for example, "xargs".
> 
> It may be arguable if it was the right thing to do, but it's too late,
> by some decades, to change it.

This is different. getdelim works perfectly for the find -print0, and
xargs -0 case. In that case *only* the \0 is used as line separator
(well you can figure out which is the line separator based on arguments,
and the applets already do that).

But there really seems to be some applets using the either of \n or \0
as line separator inside same file thing.


More information about the busybox mailing list