From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id BAA18039 for ; Sat, 29 Jun 1996 01:06:30 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id KAA08641; Fri, 28 Jun 1996 10:54:06 -0400 (EDT) Resent-Date: Fri, 28 Jun 1996 10:54:06 -0400 (EDT) Message-Id: <199606281452.QAA23567@hydra.ifh.de> To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: arr=('') broken Date: Fri, 28 Jun 1996 16:52:14 +0200 From: Peter Stephenson Resent-Message-ID: <"uw74w1.0.x62.D8_qn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1459 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Assigning empty strings to arrays (set -A still works OK) was broken by the changes in untokenisation. This broke my multicomp function. % sofar=('') % print $#sofar 0 The patch should be something like the following. I've written it this way on the assumption that if we get as far as the array code, the list must have passed through globlist and hence has had unwanted elements pruned already. As I understand it, globlist() now always returns untokenised text, and one needs to be careful not to untokenise twice which can in principal do bad things to eight-bit-cleanliness, which is why I added the first hunk and removed the untokenize() in the second hunk. *** Src/exec.c~ Fri Jun 21 10:47:16 1996 --- Src/exec.c Fri Jun 28 16:46:44 1996 *************** *** 1047,1053 **** if (empty(vl)) val = ztrdup(""); else { ! untokenize(peekfirst(vl)); val = ztrdup(ugetnode(vl)); } if (xtr) --- 1047,1054 ---- if (empty(vl)) val = ztrdup(""); else { ! if (!isset(GLOBASSIGN)) ! untokenize(peekfirst(vl)); val = ztrdup(ugetnode(vl)); } if (xtr) *************** *** 1066,1075 **** char *pp; pp = (char *) ugetnode(vl); ! if (*pp) { ! *ptr = ztrdup(pp); ! untokenize(*ptr++); ! } } *ptr = NULL; if (xtr) { --- 1067,1073 ---- char *pp; pp = (char *) ugetnode(vl); ! *ptr++ = ztrdup(pp); } *ptr = NULL; if (xtr) { -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77330 Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, 15735 Zeuthen, Germany.