Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Crash when exporting scalar without value and getsparam fails



On Jan 10,  9:25am, Bart Schaefer wrote:
}
} @@ -1935,7 +1935,7 @@ typeset_single(char *cname, char *pname, Param pm, UNUSED(int func),
}       * even if that's unset
}       */
}      if (pm && (pm->node.flags & PM_SPECIAL))
} -	usepm = 1;
} +	usepm = 2;	/* indicate that we preserve the PM_UNSET flag */
}  
}      /*
}       * Don't use an existing param if

Upon further reflection:

diff --git a/Src/builtin.c b/Src/builtin.c
index 8dee8f9..9258ddb 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1934,7 +1934,7 @@ typeset_single(char *cname, char *pname, Param pm, UNUSED(int func),
      * We need to compare types with an existing pm if special,
      * even if that's unset
      */
-    if (pm && (pm->node.flags & PM_SPECIAL))
+    if (!usepm && pm && (pm->node.flags & PM_SPECIAL))
 	usepm = 2;	/* indicate that we preserve the PM_UNSET flag */
 
     /*



Messages sorted by: Reverse Date, Date, Thread, Author