Split head.c into two files

2011-02-23 Thread Bjartur Thorlacius
head.c is too complicated for a newbie to grasp at first glance. I suggest splitting the all but last N lines feature (head -n +$n) into a seperate source file, and preferably a seperate binary as well.

Re: Split head.c into two files

2011-02-23 Thread Eric Blake
On 02/23/2011 11:56 AM, Bjartur Thorlacius wrote: head.c is too complicated for a newbie to grasp at first glance. I suggest splitting the all but last N lines feature (head -n +$n) into a seperate source file, and preferably a seperate binary as well. Thanks for the suggestion; however, I

bug#8001: cp (8.10) sparse handling fails on compressed btrfs (cp/fiemap-2)

2011-02-23 Thread Pádraig Brady
On 23/02/11 03:31, Chris Mason wrote: I've got a fix for this on the btrfs side in testing. It is definitely a btrfs bug. [resend] Cool. I'm closing this ticket, so. Interesting I didn't notice this with kernel-2.6.38-0.rc4.git0.2.fc15.i686 (with a 1G loop back BTRFS on ext4) I'd appreciate

bug#8102: [head] do not return EXIT_SUCCESS upon premature EOF

2011-02-23 Thread Bjartur Thorlacius
% echo | head -n2 echo bug bug This bit me when writing a line oriented prompter (which would `while head -n1`). FYI, this also applies to FreeBSD head.

bug#8102: [head] do not return EXIT_SUCCESS upon premature EOF

2011-02-23 Thread Eric Blake
On 02/23/2011 11:58 AM, Bjartur Thorlacius wrote: % echo | head -n2 echo bug bug This bit me when writing a line oriented prompter (which would `while head -n1`). FYI, this also applies to FreeBSD head. That's because this is not a bug, but a POSIX requirement:

bug#8103: NUL terminated lines

2011-02-23 Thread Bjartur Thorlacius
Maybe we should modify tac to add the -z option. Would you care to write a patch? It would be redundant, as tac -s $'\0' is equivalent. If you want to switch between newline characters dynamically (a bad idea, IMO) you could edit libc/stdio-common/getline.c to pass read in the newline