From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29772 invoked from network); 15 Dec 1998 06:09:58 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 15 Dec 1998 06:09:58 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id BAA00048; Tue, 15 Dec 1998 01:08:58 -0500 (EST) Resent-Date: Tue, 15 Dec 1998 01:08:58 -0500 (EST) From: "Bart Schaefer" Message-Id: <981214220746.ZM3983@candle.brasslantern.com> Date: Mon, 14 Dec 1998 22:07:46 -0800 X-Mailer: Z-Mail (4.0b.820 20aug96) To: zsh-workers@math.gatech.edu Subject: PATCH: 3.1.5-pws-3: setsparam() and sethparam() bugs MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"Y3KD5.0.e.vpVTs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4794 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu This patch must be applied after my previous sethparam() patch. It fixes two problems: 1. setsparam() must unset and recreate a PM_SCALAR when the name refers to an existing PM_HASHED, as well as when it refers to an existing PM_ARRAY. 2. sethparam() must unset and recreate anything other than a PM_HASHED, even though setaparam() can handle both PM_ARRAY and PM_HASHED. Index: Src/params.c =================================================================== --- params.c 1998/12/15 00:40:02 1.15 +++ params.c 1998/12/15 06:01:47 @@ -1480,7 +1480,7 @@ } else { if (!(v = getvalue(&s, 1))) createparam(t, PM_SCALAR); - else if (PM_TYPE(v->pm->flags) == PM_ARRAY && + else if (PM_TYPE(v->pm->flags) & (PM_ARRAY|PM_HASHED) && !(v->pm->flags & PM_SPECIAL) && unset(KSHARRAYS)) { unsetparam(t); createparam(t, PM_SCALAR); @@ -1557,7 +1557,7 @@ } else { if (!(v = getvalue(&s, 1))) createparam(t, PM_HASHED); - else if (!(PM_TYPE(v->pm->flags) & (PM_ARRAY|PM_HASHED)) && + else if (!(PM_TYPE(v->pm->flags) & PM_HASHED) && !(v->pm->flags & PM_SPECIAL)) { unsetparam(t); createparam(t, PM_HASHED); -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com