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

PATCH: typeset -U array; array=(1 2 1) bug



I'll try to send in the patches left in my queue missing from 3.1.3.
Here is the first one.  It fixes the bug:

typeset -U array; array=(1 2 1)

creates a non-unique array.

Zoli

*** Src/params.c	1997/09/19 05:34:49	3.1.3.3
--- Src/params.c	1997/09/20 06:37:55	3.1.3.4
***************
*** 1047,1054 ****
  	    createparam(t, PM_ARRAY);
  	else if (PM_TYPE(v->pm->flags) != PM_ARRAY &&
  		 !(v->pm->flags & PM_SPECIAL)) {
  	    unsetparam(t);
! 	    createparam(t, PM_ARRAY);
  	    v = NULL;
  	}
      }
--- 1047,1055 ----
  	    createparam(t, PM_ARRAY);
  	else if (PM_TYPE(v->pm->flags) != PM_ARRAY &&
  		 !(v->pm->flags & PM_SPECIAL)) {
+ 	    int uniq = v->pm->flags & PM_UNIQUE;
  	    unsetparam(t);
! 	    createparam(t, PM_ARRAY | uniq);
  	    v = NULL;
  	}
      }



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