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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8090 invoked from network); 30 Apr 2021 00:41:05 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Apr 2021 00:41:05 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1619743265; b=cl3I22U2opDIsMJEoXxmEonBRhLCyGiA+HCOztoh9pS5KnvAJ4z/jb5bN9bRtnngvIL1/RNY2W M+gxR0nxa9oiF7di2mMwlmUGLmQIQCLA6E1XNnhMsr755cLbLS7xBUGHylRcbnRT/LqPzuRmWd LNeDDDr2E3zmpxSw+XQi7i3ihAIaA/XXJgqaZByQdrptoZbSB5Q7wxnOFbGovUtE3+Q83FxOBP xij/CWghzgz0Q5Y0RSW9FQ4HTrjLU29p2jxUe5jjwnQPRQmeQH+w/DQSpXYmpOQK4iK9q0dnLZ CyAhVMiN33Aa695OXg+F/BphUEg4VwRMURkoBWp8tl2kmw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f49.google.com) smtp.remote-ip=209.85.210.49; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1619743265; bh=4pF7/lCXo+HX5fveDUSrVcdSAOI0zYaUqdpNgs4sOyQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:From:Date:DKIM-Signature:DKIM-Signature; b=E++4FvFAuWvngxutmSwR0lmR6aN9xC83CFf+K2Su3/a6uJiNSgyEMkbjfpt6xOLG+KggLS233r 59s+NNTWMX+SVZsMNS1+IgLJ7On/UcOkhFERCcSYdj5+7hqMAb+NxwBDRjD/PywP+Nm+3Pca7Q M6UOTU+hZArbJjEzEXyowI5XqslxriSq5hBQZ1zb54T4sSTGUyvuPY0PXl/nUvsbll/9E/D5MA +iIaRDYSTmTR7VRTSxzxL4MvowchoCJ+lcuUclVQhuzMnRHQBac5qE6yrEg1qcNSJ+vh+vEP7D OdHAxNhkY5n1ptBWbQc1WTeQu0x5A7d/zIQtAQa2WdnsjQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=KYLfdn0G3XD0iu7m+XKW5N/wB6Clw11X6sFhi4dJLRY=; b=VtOjlSJFhN7iknmIgwqLAzmd1d cBDLzR0vWMmplVN8ibPIbN4vlkYvTIqgV0eKqlNYKipJQtGiUGSi2EpYVhFNDssdKgO+EjVFbfA7p 5eHzP6TXzpixzi5qGwBmAULOuvcxjCTyOMqgODODiM90htjuknhxSmgzMK55cq5ZSrOGQXJkLcLt8 AGKA7EbFq05Hi3T2W7f//ste1fGHOtdk9ui3t10VYg0iQlGCVxQOEAlllA6Pe+vofCneUR/Pz9uTj sCEG2JKS3O2ucorBEYZNteOwridaE/v7w9RyL+tUhYxvWI6HNfztmf3Uz8bdui+wBZMA+lUDK0Ae7 LSraZfQw==; Received: from authenticated user by zero.zsh.org with local id 1lcHDM-000Pag-UE; Fri, 30 Apr 2021 00:41:04 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f49.google.com) smtp.remote-ip=209.85.210.49; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ot1-f49.google.com ([209.85.210.49]:38625) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lcHD3-000PKZ-EL; Fri, 30 Apr 2021 00:40:45 +0000 Received: by mail-ot1-f49.google.com with SMTP id v23-20020a9d60570000b02902a53bac99a3so8270416otj.5 for ; Thu, 29 Apr 2021 17:40:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=KYLfdn0G3XD0iu7m+XKW5N/wB6Clw11X6sFhi4dJLRY=; b=QMZ5aNe0A5DhFWO4gXUNv5bep1wDsYtQOd1MRnGljcFbXe6PWkz4GVycy6GRujYk1K fC1UzFGEEwXznSabjyTPnumMda+loRc6Blt0M3HHfPh2httoVD6K8QgozIb2To9uVS5O UEKtp2hYr7Zgsx7csNjLnHGQBCU5ZPup4DwcyXxaXFI87jXNzEHXnLEVZNqUcSQlYgMP krRz01jOmkhGYK1TVyZBA9pDJjIcEuChlb27ExbPFG6pR85rJmZRemuulHEgMNZMp4eL v5FrCkYIoa3ECwqzQVYsuFDtbovWDQW8wVyIyikXKp0OAax9b5Zp+m/jIvu5NfRQPRIP 2PXg== 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:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=KYLfdn0G3XD0iu7m+XKW5N/wB6Clw11X6sFhi4dJLRY=; b=qCNGJAgBKJuUGFQM5zoQeul2Ww3+IFvXOHWdYIcRmy8BCieefGqCslj7J3jSPsvkYh Ypj/khvsMBc9h90L2nVw8T31QVBwRj8N+sOxGiqH81XVkG7ouLXQtOTmhzcGxOqmKKVG wVCoq9w7CD/5XbVq7gD1UWxZyzNJO1jmC+KlhtGbPJATv90q0dNyz0jNCreEsI3+xwTb AQpL+2zCrgX/Q/WHJ7TxtTVrfkWpW3U5Ec8l2Gg5IaLEdW3uwWsyAINTFrtRWruKOcDR GrWlWHdtZLbbV0PH72lm2+7Rq29lc+iPrbSh7FSAHBw5QtS/TQP0i+JUYnj5xuzxKczD T6WA== X-Gm-Message-State: AOAM532LuDBRjlsu67T/kfzHtI7BledCDZ30NfznCVQYxQTeIvAOHnhf p63E5IQHZRairuc3cOyMhCI9ZVVYFIA= X-Google-Smtp-Source: ABdhPJyp7pMmZPFNqPlGvtqGdrvhSHKQurCL+p2wgEwDG/cVIxd/b/0O79/ExKPjrFbTALnuQUMKiA== X-Received: by 2002:a9d:6947:: with SMTP id p7mr1584532oto.334.1619743244104; Thu, 29 Apr 2021 17:40:44 -0700 (PDT) Received: from CptOrmolo.darkstar (cpe-70-113-147-195.tx.res.rr.com. [70.113.147.195]) by smtp.gmail.com with ESMTPSA id e30sm326023oow.11.2021.04.29.17.40.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 17:40:43 -0700 (PDT) Date: Thu, 29 Apr 2021 19:40:41 -0500 From: Matthew Martin To: zsh-workers@zsh.org Subject: Re: Bug in Functions/Misc/regexp-replace Message-ID: Mail-Followup-To: zsh-workers@zsh.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Seq: 48745 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: On Thu, Apr 29, 2021 at 07:53:52PM -0400, Jacob Menke wrote: > Hello, > > I think I found a bug in Functions/Misc/regexp-replace > One way to fix: > 41: eval ${1}=${(qqq)5} > > Patch file is attached. Thanks for the report, minimal reproducer, and patch. I think it would make sense to swap the eval for ${(P) ::= here as below. diff --git a/Functions/Misc/regexp-replace b/Functions/Misc/regexp-replace index dec105524..ff82c39b6 100644 --- a/Functions/Misc/regexp-replace +++ b/Functions/Misc/regexp-replace @@ -38,6 +38,6 @@ while [[ -n $4 ]]; do done 5+=$4 -eval ${1}=${(q)5} +: ${(P)1::=$5} # status 0 if we did something, else 1. [[ -n $6 ]]