coreutils
[Top][All Lists]
Advanced

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

Re: RFE: head,tail: -z, --zero-terminated


From: Jim Meyering
Subject: Re: RFE: head,tail: -z, --zero-terminated
Date: Sat, 26 Sep 2015 13:17:27 -0700

On Sat, Sep 26, 2015 at 10:42 AM, Pádraig Brady <address@hidden> wrote:
> On 26/09/15 15:43, Richard Russon wrote:
>> I'd like to add an option to both head and tail,
>> to allow them to work with NUL-terminated lines of text
>>      -z, --zero-terminated
>>
>> Thus allowing:
>>
>>      find dir -type f -print0 | head -z -n 10 | xargs -0 command
>>
...
>> +/* Character to split lines by. */
>> +static char line_end;
...
>> @@ -2210,6 +2219,7 @@ main (int argc, char **argv)
>>
>>     count_lines = true;
>>     forever = from_start = print_headers = false;
>> +  line_end = '\n';
>>     obsolete_option = parse_obsolete_option (argc, argv, &n_units);
>>     argc -= obsolete_option;
>>     argv += obsolete_option;

Thanks for the patch.

Please hoist each of those default initializations of "line_end" to
the point of declaration.



reply via email to

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