From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17290 invoked by alias); 15 Jun 2017 08:19:02 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41305 Received: (qmail 5543 invoked from network); 15 Jun 2017 08:19:02 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr0-f174.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.174):SA:0(-1.0/5.0):. Processed in 1.092418 secs); 15 Jun 2017 08:19:02 -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.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: stephane.chazelas@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.128.174 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=p+DIbkI0LqJgmTDzAjFHOsFj2h+B5DMkrCJ69ByFKD4=; b=OJpGpbmhAwlDJZe4Hk8gFCZxpEoiM/6lAv+YjbdSIU2DQfqo0uJlWekbwpuxLrtaDC hzuvEzz1GQNSzlUYrzQ5J3uxma9c6+fXgbddDzEDsmgLv7FwZY06Gb46s/FRgCBoYlkl wct9QhMDJBsnn7qlfxyhoqqnExN8Ngmfk4TQYrtf7iVe13f180xDaEmuAcU+5J92L7JI /9EuGhyG0Y6Ts5UhOQls9WaLk54v5prpAHT8CZOGlULLfoo2cPlE3vNZ0VL/KSMff/eV si66fxadyTniYjJ/VXI5H6fYo9zzLlHbBC+ap7neAHpv4wS/q19GEmyTHdZCF7QtQHmV G/3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=p+DIbkI0LqJgmTDzAjFHOsFj2h+B5DMkrCJ69ByFKD4=; b=CSFyb2mTO5E/m5WaxYsyHHlAVllDl1qbpPR+fqUxix+pK0YSCQYnPXgrhVNM5DzpbJ Et4aP9iN6CK4eFpcfLeuAkpQvsP6D8Lhd47xNJ4GJCghhHMAPL3BcDr3UXrWH3yCrPkp AI7sX7WDCYn0c2SA0JDNcg74xPMzZFRrM4+VsezmOR4SKBdMROSuMqqQgJUD2X+bp9U9 2nRUHNfCThZjXr6oKDfM6Lkct00/FkxAAMSgwg9K0EbI2rCmG15t9IfvIirMlgB7eCeX iMC4sE11EhOTpJCI81torhKLND+cfWSrwfyJsdz+2qO+XOvp41+J5RxRVxrpk1ryeoMW P0YA== X-Gm-Message-State: AKS2vOyDuneOe3h4MNoZu7DTAEWY/sj171I2YOvYXfPYPwZ2F41K3gna IG600oYtP+2KBuQN X-Received: by 10.28.128.198 with SMTP id b189mr2604475wmd.79.1497514730907; Thu, 15 Jun 2017 01:18:50 -0700 (PDT) Date: Thu, 15 Jun 2017 09:18:48 +0100 From: Stephane Chazelas To: Phil Pennock Cc: Zsh hackers list Subject: Re: =~ doesn't work with NUL characters Message-ID: <20170615081848.GA2416@chaz.gmail.com> Mail-Followup-To: Phil Pennock , Zsh hackers list References: <20170613100217.GA9529@chaz.gmail.com> <20170614204938.GA76510@tower.spodhuis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170614204938.GA76510@tower.spodhuis.org> User-Agent: Mutt/1.5.24 (2015-08-30) 2017-06-14 16:49:38 -0400, Phil Pennock: [...] > Trying to support this would result in variations in behaviour across > systems in a way which I think might be undesirable. The whole point of > adding the non-PCRE implementation was to match Bash behaviour by > default, and Bash does the same thing. [...] Note that bash does not support the NUL character anywhere (except (mostly by accident) for read -d '' and now readarray -d '', and it strips it in some contexts to limit the damage). In bash, [[ $'a\0b' = a ]] would also be true, just like echo $'a\0b' would output a\n because $'x\0anything' is always x there. zsh AFAIK is the only shell that attempts to handle the NUL character (making it the only shell that can reliably handle arbitrary data internally). There are still a few issues here and there like this one (or the strcoll() one discussed not so long ago), when interacting with the rest of the system that can't cope with it. The most obvious one and that can't be fixed is the parameters to the execve() system call (external command arguments and environment variables). -- Stephane