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

PATCH: Re: coredump on dev-7 (ALL_EXPORT)



The completion system definitely should not use ALL_EXPORT.

The real problem, however, is that arrays and hashes can't be exported.
I've stubbed in some #if 0 code to handle ksh-style array export as was
discussed way back in zsh-workers/9576 and related messages, but there
are a number of other places that check for arrays or hashes and either
skip calling export_param or don't set the PM_EXPORTED flag, and I don't
have time to conduct a thorough search or testing pass for all of them.

Index: Completion/Core/compinit
===================================================================
@@ -134,6 +134,7 @@
     NO_shglob
     NO_ksharrays
     NO_cshnullglob
+    NO_allexport
 )
 
 # These can hold names of functions that are to be called before/after all
Index: Src/params.c
===================================================================
@@ -1484,7 +1484,19 @@
 {
     char buf[(sizeof(zlong) * 8) + 4], *val;
 
-    if (PM_TYPE(pm->flags) == PM_INTEGER)
+    if (PM_TYPE(pm->flags) & (PM_ARRAY|PM_HASHED)) {
+#if 0	/* Requires changes elsewhere in params.c and builtin.c */
+	if (emulation == EMULATE_KSH /* isset(KSHARRAYS) */) {
+	    struct value v;
+	    v.isarr = 1;
+	    v.inv = 0;
+	    v.start = 0;
+	    v.end = -1;
+	    val = getstrvalue(&v);
+	} else
+#endif
+	    return;
+    } else if (PM_TYPE(pm->flags) == PM_INTEGER)
 	convbase(val = buf, pm->gets.ifn(pm), pm->ct);
     else if (pm->flags & (PM_EFLOAT|PM_FFLOAT))
 	val = convfloat(pm->gets.ffn(pm), pm->ct,

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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