From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19889 invoked from network); 1 Jun 1999 08:49:29 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Jun 1999 08:49:29 -0000 Received: (qmail 10597 invoked by alias); 1 Jun 1999 08:49:18 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6412 Received: (qmail 10589 invoked from network); 1 Jun 1999 08:49:18 -0000 Date: Tue, 1 Jun 1999 10:49:16 +0200 (MET DST) Message-Id: <199906010849.KAA20110@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Tue, 1 Jun 1999 04:50:15 +0000 Subject: Re: Singleton arrays treated as scalars (redux) Bart Schaefer wrote: > I think I've figured out why paramsubst() converts one-element arrays into > scalars. Consider the case where zsh needs to expand > > some${param}thing > ... > > The one-element array case can't be handled like the two-or-more case; it > must be handled like the scalar case. So zsh does the simplest thing, and > turns the array into a scalar so that it will take that code branch. This > also prevents it from attempting plan9 (rcexpandparam) concatenation when > there is only one element. Aha. > However, there's one spot where I think mult_isarr is not correctly set, > and another spot where isarr is compared to 2 even though in that branch > it can't possibly have any value other than 0. Patch appended, someone > please check it for sanity. As far as I can see, this looks good (I saw this superfluous isarr!=2, too, when playing with mult_isarr, I was just to superstitious to remove it). Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de