From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24557 invoked by alias); 8 Dec 2017 22:51:34 -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: List-Unsubscribe: X-Seq: 42097 Received: (qmail 19972 invoked by uid 1010); 8 Dec 2017 22:51:34 -0000 X-Qmail-Scanner-Diagnostics: from mail-it0-f53.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.214.53):SA:0(-2.6/5.0):. Processed in 1.97604 secs); 08 Dec 2017 22:51:34 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=yNAE469D/R+UsqTfJDiSNO85XE4DunILUZDuV4ap9a4=; b=gqkvwhyiCeEAbndxBhvTePOPQ1qOSRMfhDoU/E0HdEh1yjU8Kcw2LxnBcoXz7cgV1j a/9ffpNYsPmRNefRWELvOkyKqYwzLPbcGJhs4CvXfpDuW/8ts5hJu5MlqENiu6cLDfUb uXXWs4ygdFjrQGpc52FgYB73FqonxLRW0US/mrOjFQ2kIvDEst8ayyP3ilnx6J/fHO7V KlitATkZe8+4LdbyVtAe3CFoRelt6Pfurz2Ljjz/F2Jrd3qVbbAKb4dNm/CaZRcnUja9 FtIWModqyn2waqqwvcEE+Knncv3elruSbu5245chTrKNiRkSJRg8S7q242nIktrD0Q/S QWbg== 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:message-id:date:to; bh=yNAE469D/R+UsqTfJDiSNO85XE4DunILUZDuV4ap9a4=; b=JvVQ/SC6JMVoW4kTPhWyfLE7uVTVavckbTKgdDKEwP/VucHvHd7HA/EMGUBHBcBP6h A3d5/U2Sz8GQDuGgYrrUQiMYVpL90jyU9bNHmssoag7/4D7NFquDjn11+1MehruFBypf lpTNwl9ThpqWHgppZ6JHNzl+e8+qIE0AfJmZY2W50lUnRxrh8xMzlYu+kB8ihBg536nx tpQiU20JuYEWqxlEQCrg7ltmMegGbddHVCVpRlj2xxLmiAzvvsi1Wjqe+YaaEkSJgtU2 KCFtZme+dDp/n5HVGteVqg48svJoPQzUJ/aMi33CVKAVUJ1SNuDFPZjO7WpGaFH2mptv Uyxg== X-Gm-Message-State: AKGB3mLwKAWMO0fzj6u6oOlK7vcDZWzpy54S0RjuRpttgdLnSzUBkVYh qHBPDXhwW6xqvLf/ZnWtpOwkSfp/XoQ= X-Google-Smtp-Source: AGs4zMbUIkisVcT8gFSRDm1lwb90+qZLUs3L6k4+zsaqbfhcOCxptoyPqXZdISuYG9fmb4TvwMcUeQ== X-Received: by 10.36.69.101 with SMTP id y98mr8025423ita.35.1512773488845; Fri, 08 Dec 2017 14:51:28 -0800 (PST) From: dana Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [BUG] Tied parameters not restored correctly after pre-command re-assignment Message-Id: <92FCFBAE-158C-4339-B374-275FD6ACDBE6@dana.is> Date: Fri, 8 Dec 2017 16:51:26 -0600 To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.3273) Daniel's recent message to zsh-users got me experimenting with the use = of tied parameters in 'pre-command' re-assignments (i.e., the `foo=3Dbar baz` = form of command). I found that, in 5.4.1 and 5.4.2-dev, tied parameters are not restored = correctly to their previous values if re-assigned in this way after calling a = shell function or built-in: % typeset -T SCA arr % arr=3D( a b ) % arr=3D( b c ) typeset -p SCA typeset SCA=3Db:c % typeset -p SCA typeset: no such variable: SCA (It works the other way around too =E2=80=94 with `SCA=3Db:c ...` it = will unset arr.) It seems that the restoration process simply doesn't concern itself with = tied parameters. It unsets the other parameter, but then there's nothing = there to set it back. I wasn't successful in trying to figure out exactly where it = could be fixed, but i see at least that the reason it unsets the other parameter = is the call to unsetparam_pm() in restore_params(). This doesn't happen when calling external commands, since the = restoration isn't relevant there. However, i also don't get the behaviour that i expect = (which is the scalar being passed down through the environment): % typeset -T SCA arr % arr=3D( a b ) % arr=3D( b c ) zsh -fc 'print -r -- ${SCA:--}' - % typeset -p SCA typeset SCA=3Da:b I guess that's probably a separate thing though. Anyway, kind of esoteric, but idk, seems like misbehaviour. dana