From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6015 invoked from network); 8 Dec 2023 22:15:53 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Dec 2023 22:15:53 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1702073754; b=WQ5zrMxQHJFzl8Zbpq5it09CNwm1GfuzU4CGlrhn80y4TLcO7OC5bL8iErloJm+8idWqSDcvwj GH5GmvAPBQZy5AguRqMMR9v4vc+I33LmdoA8X7kByOKQLKGPy9fq3FYXqEh0wMFsZ8JoFDXSRQ OXxlOMRTy+/5H/AmjXy3OHgQBYCZqNREMr2ZXc60V0zs2KdFgXNJxpp1R9//F1Ob4EEJVBPBlx CtiH3PfnmKV5cCA3Lmblks64ckprMlBHP2hN7hOz/jNJ9YMslHUJm/QZmR0gwS20pxbivQOwrb UIeGMS7wyqIq8V+AXobQqdmjQgwVQQMCLPwBZqZ7h4r95A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f41.google.com) smtp.remote-ip=209.85.218.41; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1702073754; bh=pag/WYoWIdj05WzHChb53E4YfEM5Rw0mgSHSk8rX1v0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=NrWPqwUYpUViuS1f3LwDlBG6PjUZ8p49kPuZ/GQG1ZsyHiE5MDAv0CCewqYd9FR8SiTOu7anpK CcC6jNo6dLe6LsvIYNRqOJdlUrXNYDqaouKqQdgDd9J/d0UDDx0eNf7RdKQa9GQ1iio2s764jh 8Kglozwqh8rDV6O3cQ86kuIyZ3/JIJSTDn7qtcvk+mXu6y8OwmLZxIj00WckL0Svodyv6C6W0B LMFGm4Y4QFU6KErNPa9PfXWY4M0+ZWyqjeKRwIPXQbKP0xut92PXQsPo2AsUZ68Gocw4IhmRlr j9grX5QY5t858stm25azACpG0yGzsWW09yVxVfNokd1k8Q==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Tbr+3Knje34+zhDleUsoT99VKEAY6BYSEKG691wRQM4=; b=iBZmdVab4ybSLm3ZAiX/rxsRM8 Qyfvo/k0GHImoOuVvzN/y0EZ1KDdyOKrxId7f9HWSjlpTBH5E2hab+aU4sZ6kj9cumBKi07KkGoDA FOs8QoFCrWo/IpakXZwi4M1bAIxX1APDNuwQAcn5xDdlm/mskxCUos6/2Udch+Irvsr8IKp9VmtXz aqTalMBockp9UwocmsUhIYo1/kUHFIsevral66dO/pZRf6FFqdCs7SXdxiQuIBotruBqCBUcCLW6e 9YzKYlBVLyo86NbG/aFizI8yZLddAxFH5VE6fXaf3trMKoROe6T6BctKdRCJyTDdtv1bJ+O84pC63 BfXebI7A==; Received: by zero.zsh.org with local id 1rBj8T-0003Hb-EP; Fri, 08 Dec 2023 22:15:53 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f41.google.com) smtp.remote-ip=209.85.218.41; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f41.google.com ([209.85.218.41]:47400) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rBj8F-0002yU-N7; Fri, 08 Dec 2023 22:15:40 +0000 Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a1f5cb80a91so231338366b.3 for ; Fri, 08 Dec 2023 14:15:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1702073739; x=1702678539; darn=zsh.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Tbr+3Knje34+zhDleUsoT99VKEAY6BYSEKG691wRQM4=; b=f0tzK5h0sWkdRylGU/q7vShqYVeCszJjASr1HhdKYmghTWr34EiN/QMpr/o2MjUria OZW3O1uCwXAdK0IHS1ZYBUWdmx3P262CdV2Icad1TLZznS9EoHah7FTAUGX0bHh/ee8V mDQS/+/X2sCUK4x/qUIrizSSq+xsKF+tOeYjQZ4Pz9zyDLZ7ySiFihGpnrqTGGIW6f5C kaz7EN2SzzOhVRjq16AP3LsWW0KaOM9FHRilSnksyXILEiz8kxyTy7qHZaKpaxG7jIN6 Q5jEfR3v0BxbEFIJ6GItYyfMPQ0G7ZNZbPu+Jja825jTd1MRMno7VOM7u8KIutnq6KCa eeiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702073739; x=1702678539; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Tbr+3Knje34+zhDleUsoT99VKEAY6BYSEKG691wRQM4=; b=DI1yWRfcPjzPLwjhEVWrpH88SOanIhfE8Q3H8k5KX4wZkehEw/EgmQTb/Amaw2DfOB jYE2WrIZpHTtTr2AhztSEa+o0YvfcyrxzdeoiPuahN36R+aZnm+NW0AyDqTWGjvs6c+n FXok+X9J6xSBCUwCXIt+O0EjgysR6AkOZjyKfqp8GUzAN9Y3FauT9Y01MFfzO1ucE5h2 aQHxV+lBoi5PjskmsJBo45iYKf4CA2dcnx8ZyrnmXDsSvbX+sIEUgb1H8dWfFwEKffrX jqxFGR4Ui3NXvYYGdFYEuut23ceBwDysEwUhvmxAA61INcFELtvjSivcRS34RwSiHlg4 2tjA== X-Gm-Message-State: AOJu0YwV+SDQPXwKzz4QSQKEgeNqpC+9yRiMkB8/357zUk/ggguO6P2p kLRl5mEjN7DoIyy0KCQ/n1sDsICFaDVY5Iqo1Om4sLUQ9kmROjFRuEE= X-Google-Smtp-Source: AGHT+IFUsBTKmSMWeMeSiLj5bfb9aeKXqDGTpspCBxK9xvZWGpOP7A+ZbKE+0Ry2yrWXSyJsl6O4/fTQzw+FslcMEs0= X-Received: by 2002:a17:906:cb:b0:a1b:7609:5d6b with SMTP id 11-20020a17090600cb00b00a1b76095d6bmr200742eji.5.1702073739004; Fri, 08 Dec 2023 14:15:39 -0800 (PST) MIME-Version: 1.0 References: <50885-1702060132.779123@YSiF.CgC_.vGLi> In-Reply-To: From: Bart Schaefer Date: Fri, 8 Dec 2023 14:15:28 -0800 Message-ID: Subject: Re: PATCH: Avoid \e in C code; building on Solaris 11 To: Oliver Kiddle Cc: Zsh workers Content-Type: multipart/alternative; boundary="000000000000985f8b060c06ecdd" X-Seq: 52385 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --000000000000985f8b060c06ecdd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 8, 2023 at 2:03=E2=80=AFPM Bart Schaefer wrote: > The test is confirming that zexpandtabs() doesn't infinite-loop on broken > multibyte input which might include nul bytes. Could replace the "tr" wi= th > 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+=3D$'\tone\ttwo\tthree\tfour\n' foo+=3D$'\t\tone\t\ttwo\t\tthree\t\tfour' foo+=3D'\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 --000000000000985f8b060c06ecdd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Dec 8, 2023 at 2:03=E2=80=AFPM Ba= rt Schaefer <schaefer@brass= lantern.com> wrote:
The test is confirming t= hat zexpandtabs() doesn't infinite-loop on broken multibyte input which= might include nul bytes.=C2=A0 Could replace the "tr" with somet= hing else.

E.g. (not bothering to wor= ry about gmail wrapping here)

diff --git a/Test/B0= 3print.ztst b/Test/B03print.ztst
index 4d2cf9764..93a9669b0 100644
--= - a/Test/B03print.ztst
+++ b/Test/B03print.ztst
@@ -305,8 +305,9 @@=C2=A0 foo+=3D$'\tone\ttwo\tthree\tfour\n'
=C2=A0 foo+=3D$'= ;\t\tone\t\ttwo\t\tthree\t\tfour'
=C2=A0 foo+=3D'\0' # regre= ssion test for multibyte tab expand
- print -x4 $foo | tr '\0' Z= # avoid raw nul byte in expected output below
- print -X4 $foo | tr = 9;\0' Z
+ # avoid raw nul byte in expected output below
+ print $= {"$(print -x4 $foo)"/$'\0'/Z}
+ print ${"$(print = -X4 $foo)"/$'\0'/Z}
=C2=A00:Tab expansion by print
=C2= =A0>one two three four
=C2=A0> =C2=A0 =C2=A0one two three four
= =C2=A0
--000000000000985f8b060c06ecdd--