zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: zsh-workers@math.gatech.edu
Subject: PATCH: 3.1.5-pws-3: setsparam() and sethparam() bugs
Date: Mon, 14 Dec 1998 22:07:46 -0800	[thread overview]
Message-ID: <981214220746.ZM3983@candle.brasslantern.com> (raw)

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


                 reply	other threads:[~1998-12-15  6:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=981214220746.ZM3983@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).