about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/params.c18
-rw-r--r--Test/V04features.ztst10
3 files changed, 29 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 822befc38..9632ab2b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2011-08-11  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
+	* Src/params.c: unposted: Src/params.c, Test/V04features.ztst:
+	fix some tests I broke.
+
 	* Src/subst.c: 29674: Src/Modules/datetime.c,
 	Doc/Zsh/mod_datetime.yo: add $epochtime array.
 
@@ -15229,5 +15232,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5419 $
+* $Revision: 1.5420 $
 *****************************************************
diff --git a/Src/params.c b/Src/params.c
index fd0872130..446cccc7e 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -3046,9 +3046,21 @@ mod_export void
 stdunsetfn(Param pm, UNUSED(int exp))
 {
     switch (PM_TYPE(pm->node.flags)) {
-	case PM_SCALAR: pm->gsu.s->setfn(pm, NULL); break;
-	case PM_ARRAY:  pm->gsu.a->setfn(pm, NULL); break;
-	case PM_HASHED: pm->gsu.h->setfn(pm, NULL); break;
+	case PM_SCALAR:
+	    if (pm->gsu.s->setfn)
+		pm->gsu.s->setfn(pm, NULL);
+	    break;
+
+	case PM_ARRAY:
+	    if (pm->gsu.a->setfn)
+		pm->gsu.a->setfn(pm, NULL);
+	    break;
+
+	case PM_HASHED:
+	    if (pm->gsu.h->setfn)
+		pm->gsu.h->setfn(pm, NULL);
+	    break;
+
 	default:
 	    if (!(pm->node.flags & PM_SPECIAL))
 	    	pm->u.str = NULL;
diff --git a/Test/V04features.ztst b/Test/V04features.ztst
index 240336611..2790456e2 100644
--- a/Test/V04features.ztst
+++ b/Test/V04features.ztst
@@ -17,18 +17,24 @@
 0:Loading modules with no features
 >-b:strftime
 >-p:EPOCHSECONDS
+>-p:EPOCHREALTIME
+>-p:epochtime
 
   zmodload -F zsh/datetime b:strftime
   zmodload -lF zsh/datetime
 0:Enabling features
 >+b:strftime
 >-p:EPOCHSECONDS
+>-p:EPOCHREALTIME
+>-p:epochtime
 
   zmodload -F zsh/datetime +p:EPOCHSECONDS -b:strftime
   zmodload -lF zsh/datetime
 0:Disabling features
 >-b:strftime
 >+p:EPOCHSECONDS
+>-p:EPOCHREALTIME
+>-p:epochtime
 
   zmodload -Fe zsh/datetime p:EPOCHSECONDS b:strftime
 0:Testing existing features
@@ -109,6 +115,8 @@
 0:Feature state with loading after error enabling
 >+b:strftime
 >-p:EPOCHSECONDS
+>+p:EPOCHREALTIME
+>+p:epochtime
 
   zmodload -F zsh/datetime p:EPOCHSECONDS
   zmodload -Fe zsh/datetime +p:EPOCHSECONDS
@@ -159,3 +167,5 @@
 0:zmodload with no -F enables all features
 >+b:strftime
 >+p:EPOCHSECONDS
+>+p:EPOCHREALTIME
+>+p:epochtime