From: Mikael Magnusson <mikachu@gmail.com>
To: Jun T <takimoto-j@kba.biglobe.ne.jp>
Cc: zsh-workers@zsh.org
Subject: Re: PATCH v2: 48168: Fix handling of NUL bytes in zexpandtabs multibyte version
Date: Thu, 1 Apr 2021 09:46:24 +0200 [thread overview]
Message-ID: <CAHYJk3S2dVRe9TU8CYitkzyDMFBs0sbcGekguSxcvizHSwvP2w@mail.gmail.com> (raw)
In-Reply-To: <33082E1F-ACF5-4B9A-A268-C2F43B11D56D@kba.biglobe.ne.jp>
On 4/1/21, Jun T <takimoto-j@kba.biglobe.ne.jp> wrote:
> The test in B03 fails on macOS and FreeBSD (and maybe on other BSDs)
> because 'sed' can't handle the null byte.
>
> It seems 'tr' is more portable.
>
>
> diff --git a/Test/B03print.ztst b/Test/B03print.ztst
> index 563423934..4d2cf9764 100644
> --- a/Test/B03print.ztst
> +++ b/Test/B03print.ztst
> @@ -304,15 +304,16 @@
> foo=$'one\ttwo\tthree\tfour\n'
> foo+=$'\tone\ttwo\tthree\tfour\n'
> foo+=$'\t\tone\t\ttwo\t\tthree\t\tfour'
> - print -x4 $foo
> - print -X4 $foo
> + foo+='\0' # regression test for multibyte tab expand
> + print -x4 $foo | tr '\0' Z # avoid raw nul byte in expected output below
> + print -X4 $foo | tr '\0' Z
> 0:Tab expansion by print
> >one two three four
> > one two three four
> -> one two three four
> +> one two three fourZ
> >one two three four
> > one two three four
> -> one two three four
> +> one two three fourZ
>
> unset foo
> print -v foo once more
Thanks for checking, I'll use this version instead.
--
Mikael Magnusson
prev parent reply other threads:[~2021-04-01 7:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-12 2:51 PATCH: " Mikael Magnusson
2021-03-12 3:17 ` Mikael Magnusson
2021-03-12 13:53 ` Daniel Shahaf
2021-03-20 1:22 ` Lawrence Velázquez
2021-03-20 15:15 ` PATCH v2: 48168: " Mikael Magnusson
2021-03-27 16:11 ` Lawrence Velázquez
2021-04-01 5:21 ` Jun T
2021-04-01 7:46 ` Mikael Magnusson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHYJk3S2dVRe9TU8CYitkzyDMFBs0sbcGekguSxcvizHSwvP2w@mail.gmail.com \
--to=mikachu@gmail.com \
--cc=takimoto-j@kba.biglobe.ne.jp \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).