bug#8103: tac RFE: accept -z, --zero-terminated option (was: bug#8103: NUL terminated lines

2011-07-22 Thread Jim Meyering
retitle 8103 tac RFE: accept -z, --zero-terminated option tags 8103 + notabug thanks Jim Meyering wrote: > Bjartur Thorlacius wrote: >>> 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. > > Are you using

bug#8103: NUL terminated lines

2011-02-25 Thread Eric Blake
On 02/25/2011 01:09 PM, Jim Meyering wrote: >> Actually the shell does. $'\0' and '' are indistinguishable once passed >> as argument. > > I thought so, too. Then I tried this: > > $ zsh -c "printf \$'\0'|wc -c" > 1 > $ bash -c "printf \$'\0'|wc -c" > 0 > > The former prints a

bug#8103: NUL terminated lines

2011-02-25 Thread Jim Meyering
Andreas Schwab wrote: > Jim Meyering writes: > >> Bjartur Thorlacius wrote: >>> On 2/24/11, Jim Meyering wrote: With GNU tac, that has never worked: $ tac -s '' tac: separator cannot be empty >>> NUL!=the empty string. >> >> tac treats them the same way. > > Actua

bug#8103: NUL terminated lines

2011-02-25 Thread Andreas Schwab
Jim Meyering writes: > Bjartur Thorlacius wrote: >> On 2/24/11, Jim Meyering wrote: >>> With GNU tac, that has never worked: >>> >>> $ tac -s '' >>> tac: separator cannot be empty >>> >> NUL!=the empty string. > > tac treats them the same way. Actually the shell does. $'\0' and '' are

bug#8103: NUL terminated lines

2011-02-25 Thread Bjartur Thorlacius
On 2/24/11, Jim Meyering wrote: > Bjartur Thorlacius wrote: >> On 2/24/11, Jim Meyering wrote: >>> Bjartur Thorlacius wrote: > 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. >>> >>> Are you usi

bug#8103: NUL terminated lines

2011-02-24 Thread Alan Curry
Bjartur Thorlacius writes: > > On 2/24/11, Jim Meyering wrote: > > Bjartur Thorlacius wrote: > >>> 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. Note that a $'\0' argument in a shell command line

bug#8103: NUL terminated lines

2011-02-24 Thread Jim Meyering
Bjartur Thorlacius wrote: > On 2/24/11, Jim Meyering wrote: >> Bjartur Thorlacius wrote: 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. >> >> Are you using a non-GNU version of tac? > I don't rem

bug#8103: NUL terminated lines

2011-02-24 Thread Bjartur Thorlacius
On 2/24/11, Jim Meyering wrote: > Bjartur Thorlacius wrote: >>> 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. > > Are you using a non-GNU version of tac? I don't remember whether I was using FreeBSD or

bug#8103: NUL terminated lines

2011-02-24 Thread Jim Meyering
Bjartur Thorlacius wrote: >> 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. Are you using a non-GNU version of tac? If so, please tell us which one -- that may influence the decision of whether to make "-

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 charac