From: Bart Schaefer <schaefer@brasslantern.com>
To: Oliver Kiddle <opk@zsh.org>
Cc: Zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: Avoid \e in C code; building on Solaris 11
Date: Fri, 8 Dec 2023 14:15:28 -0800 [thread overview]
Message-ID: <CAH+w=7Yx4CcaZt2qFG_69mtrJRQT=gWFoajb5aMA5EQV5AUATw@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7ZuvPdqnTVvpZmhW=khZekc6DiTxM6ai6Hi0cmDnfNh5A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 933 bytes --]
On Fri, Dec 8, 2023 at 2:03 PM Bart Schaefer <schaefer@brasslantern.com>
wrote:
> The test is confirming that zexpandtabs() doesn't infinite-loop on broken
> multibyte input which might include nul bytes. Could replace the "tr" with
> something else.
>
E.g. (not bothering to worry about gmail wrapping here)
diff --git a/Test/B03print.ztst b/Test/B03print.ztst
index 4d2cf9764..93a9669b0 100644
--- a/Test/B03print.ztst
+++ b/Test/B03print.ztst
@@ -305,8 +305,9 @@
foo+=$'\tone\ttwo\tthree\tfour\n'
foo+=$'\t\tone\t\ttwo\t\tthree\t\tfour'
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
+ # avoid raw nul byte in expected output below
+ print ${"$(print -x4 $foo)"/$'\0'/Z}
+ print ${"$(print -X4 $foo)"/$'\0'/Z}
0:Tab expansion by print
>one two three four
> one two three four
[-- Attachment #2: Type: text/html, Size: 1383 bytes --]
next prev parent reply other threads:[~2023-12-08 22:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 18:28 Oliver Kiddle
2023-12-08 22:03 ` Bart Schaefer
2023-12-08 22:15 ` Bart Schaefer [this message]
2023-12-09 23:04 ` Oliver Kiddle
2023-12-10 0:29 ` Bart Schaefer
2023-12-09 22:41 ` Oliver Kiddle
2023-12-09 23:43 ` Oliver Kiddle
2023-12-10 0:33 ` Bart Schaefer
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='CAH+w=7Yx4CcaZt2qFG_69mtrJRQT=gWFoajb5aMA5EQV5AUATw@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=opk@zsh.org \
--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).