zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: 3.1.5-pws-3: setsparam() and sethparam() bugs
@ 1998-12-15  6:07 Bart Schaefer
  0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 1998-12-15  6:07 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-12-15  6:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-15  6:07 PATCH: 3.1.5-pws-3: setsparam() and sethparam() bugs Bart Schaefer

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).