From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11049 invoked by alias); 20 Apr 2018 22:05:04 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23359 Received: (qmail 8474 invoked by uid 1010); 20 Apr 2018 22:05:04 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr0-f170.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.128.170):SA:0(-1.9/5.0):. Processed in 1.485118 secs); 20 Apr 2018 22:05:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: enrico.m.crisostomo@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=NFGgJHofPWQLzyKNMlujBQq1sS51O68TymwLlgjCUyk=; b=I45bbgFF2EHzf0cj9zJcTNDvEv2EvD5tbZMPhioeUxdoZebbmA9uLg6DpfUTd1wGZ3 qIc7wbjCkkv4YLDJv1xUMS1KddOrhc6ix8xLt/jIQH6k7CcMmrsxzr3dikhO7UpyOdLY qf9v0xkCXaTIf3y0vjzsL6XFa2H9/pLmmKYQsrg4+mFhty8gQvEaU3zTDebi3hkk3LBo ywnWf0Rggf8OYK2ZGeRVfP4uf4Tmnghn3ux84XQKEZUBaRIy8FC4+mAs7Vq2eKAzojb/ jLAw+ZX9/gGodU+AIdHiEY5x2nmjEJHcyli6KH9PXqwZkG7AaBJY6F/s975m7Zmgavae /QEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=NFGgJHofPWQLzyKNMlujBQq1sS51O68TymwLlgjCUyk=; b=hcWvKK6o4zMCwGZRKQ/SZbJsm/XzejgC7IEOGuIDVDiH21IARCRFlqHu45OTEMGC8s 8ATXkakeIOTvXxnEoEeeUUcQMh7wtF+j8DY045jkA4Cgt298SEL9qHi8ceb6emhGMxUU tz9ajuuYMepjte9I1iB+dCZTJiLc518OhsZyK8qhTKaPPMv2UY+ursDQFQC41a6YNYSy Z5KRpK6ZLEyP5QHgetQkB/GEfqB0zAa6J8HA35O4pujNsJIRj0gxaUFvl4kNIX+Dj1Jh yzRSCWhWw5e7KmB1q8A1ozDHnCbdpbDDg9V+imd+e7ix7xjYMUXl+4OzFIZgqIQGH2Sj AoTw== X-Gm-Message-State: ALQs6tBB69RgLqtNsIeShP3b/BThq97VcJDFXe9ppCW7Xy2E6m+MgZSQ RHPUrxsyybh28sMe5SRlHuW1C7w9 X-Google-Smtp-Source: AIpwx4/vyBIEZcQKjlK154espE4SxyMHC30FbcthUgdcqoNWolBOSXhI4oiLHg3seq1yI4G72tbicw== X-Received: by 2002:adf:8062:: with SMTP id 89-v6mr9624455wrk.141.1524261899090; Fri, 20 Apr 2018 15:04:59 -0700 (PDT) From: Enrico Maria Crisostomo Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: Different behaviour when interpreting a here-document between 5.3 and 5.5.1 Date: Sat, 21 Apr 2018 00:04:56 +0200 References: To: zsh-users@zsh.org In-Reply-To: Message-Id: <54E1C2BA-1A1B-4C54-85B8-2BF958938213@gmail.com> X-Mailer: Apple Mail (2.3445.6.18) > On 19 Apr 2018, at 23:52, Enrico Maria Crisostomo = wrote: >=20 > Hi, >=20 > I'm struggling with an apparently simple problem. A script of mine = has a function that writes a here-document whose lines end with a = backslash. The script has been working fine until zsh has been updated = recently. >=20 > The relevant part of the code is the following >=20 > mp_calculate_checksums() > { > cat < checksums rmd160 ${CHECKSUM_RMD160} \\ > sha256 ${CHECKSUM_SHA256} \\ > size ${CHECKSUM_SIZE} > EOF > } >=20 > The expected output is something like: >=20 > checksums rmd160 281d97a37125fca07ff81a72ac337f6a23f5d2b0 \ > sha256 = 233cd8724fd95e10b82ed62c692e7e79cca9114b49be834e65cd05b529d8ba70 \ > size 31 >=20 > When running the same script on 5.5.1, I get a single line of output, = as if the last backslash of \\ were escaping the newline. >=20 > checksums rmd160 281d97a37125fca07ff81a72ac337f6a23f5d2b0 \ = sha256 = 233cd8724fd95e10b82ed62c692e7e79cca9114b49be834e65cd05b529d8ba70 \ = size 31 >=20 > I haven't been able to troubleshoot it so far, and the zsh = documentation seems to imply that the correct behaviour is the former, = not the latter. >=20 > Thanks in advance for you help, > --=20 > Enrico Thanks for your answer, Bart. Apologies for manually quoting it, but I = haven't received a mail from the mailing list, so I can't reply: > Yeah, this is commit 47aa6095 aka workers/42355. It's recognizing > backslash-newline but not whether the backslash is itself escaped. >=20 > The NEWS file should have mentioned the change to here-documents, I > think. However, not catching the double backslash is a bug. However, > part 2, figuring this out requires scanning backwards to see if you > have an even or odd number of trailing backlashes, or scanning forward > and tokenizing while consuming the document. Bleah. Should I file a bug report, write to zsh-workers, or do something else? = Or may I consider that your answering the mail is equivalent to a bug = having been open? Thanks, --=20 Enrico=