Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Qmail-Scanner-Diagnostics: from mail-pa0-f49.google.com by f.primenet.com.au (envelope-from <schaefer@brasslantern.com>, uid 7791) with qmail-scanner-2.11 
 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1.  
 Clear:RC:0(209.85.220.49):SA:0(0.0/5.0):. 
 Processed in 0.168212 secs); 11 Aug 2016 17:33:54 -0000
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID
	autolearn=unavailable autolearn_force=no version=3.4.1
X-Envelope-From: schaefer@brasslantern.com
X-Qmail-Scanner-Mime-Attachments: |
X-Qmail-Scanner-Zip-Files: |
Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=brasslantern-com.20150623.gappssmtp.com; s=20150623;
        h=from:message-id:date:in-reply-to:comments:references:to:subject
         :mime-version;
        bh=YisdaHrR1h+Vthutulunzd3ezs9YjlYyO1buNRDCpLU=;
        b=A1IuihMr8PiE0guirhw27szwG0qsw2c/loZwFavYvV2bTP6JjMc/VVyaHsjMjBqRtr
         x5loOT8OUpJ1W/7ClROk5Z9teReYE6AzqRvCGFdR01bx6usDb+FffSj5rL7h+WETmTiH
         5iW/wXTPyhiOC8Mh84iNfLfViHZjov8AWGVmw0pSFbYb2XZzaD0CfNmekaJ6d1MWMqHz
         L4cHCpLPYnjRcWkyPLDT/QQ0qx8c3Ex5CtJ86nWErukDOmby0EdWO0m5oWyqQVj39rk8
         bAS4bJ4JuQHxsrz9acMyUtWSGAXWxhwhqesdjb6uWVw0qSLLe9cbJoiA8r2Kg7h4Bhd7
         SgAQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:date:in-reply-to:comments
         :references:to:subject:mime-version;
        bh=YisdaHrR1h+Vthutulunzd3ezs9YjlYyO1buNRDCpLU=;
        b=my+ckQOnrhe8bpIvVEW6uJRrAHuJc/HDY9xV4j+IPYaPJU9AMiCCr1bz/+5LmCAf/z
         tdojpsfw8c/sLAVEwabhJLRVjuNbwikd3IBJzCN2lvnTg4etaA1mwwJc5P0WxCO0uAbF
         bCdetwESv1jyU1yEJDM3Hvo3ocVuJBxk5K/i5NMS0L0yEUSU4ozcdH6nYH7mhMNjfLx5
         n3/7SWDVaCowgnANPfoqRiHL+gBEa8UkYZwzJQg8NiCKRfh5zhhY3hPWemh3E7wG2agJ
         3bZuysl3qmLcV4yr5pCFU91kfVdLmrcJi/PDohHkcGe11VVdBheI+CxHbT3Ujar93hA2
         RWlw==
X-Gm-Message-State: AEkoouvj8HvzxxAYFyDNAtPUMDnQK97ePM/Q1OELT+3jX1SvOu3OUf9QzI0rA3sL5aS+sQ==
X-Received: by 10.66.134.131 with SMTP id pk3mr19156706pab.90.1470936486094;
        Thu, 11 Aug 2016 10:28:06 -0700 (PDT)
From: Bart Schaefer <schaefer@brasslantern.com>
Message-Id: <160811102803.ZM2533@torch.brasslantern.com>
Date: Thu, 11 Aug 2016 10:28:03 -0700
In-Reply-To: <20160811110545.1b066d2f@pwslap01u.europe.root.pri>
Comments: In reply to Peter Stephenson <p.stephenson@samsung.com>
        "Re: [bug] shwordsplit not working on $@ when $# > 1" (Aug 11, 11:05am)
References: <20160808111626.GA19766@chaz.gmail.com> 
	<20160808192734.21923640@ntlworld.com> 
	<160808182124.ZM9355@torch.brasslantern.com> 
	<20160809094013.01f0f5f8@pwslap01u.europe.root.pri> 
	<160810102836.ZM15324@torch.brasslantern.com> 
	<20160811110545.1b066d2f@pwslap01u.europe.root.pri>
X-Mailer: OpenZMail Classic (0.9.2 24April2005)
To: zsh-workers@zsh.org
Subject: Re: [bug] shwordsplit not working on $@ when $# > 1
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Seq: zsh-workers 39025

On Aug 11, 11:05am, Peter Stephenson wrote:
} Subject: Re: [bug] shwordsplit not working on $@ when $# > 1
}
} On Wed, 10 Aug 2016 10:28:36 -0700
} Bart Schaefer <schaefer@brasslantern.com> wrote:
} > torch% print -l ${(@s.:.)x}
} > a:b
} > c d
} > ef
} 
} I think it should only cause a visible effect in double quotes as that's
} its real point --- though I wouldn't be surprised if there were already
} exceptions.  It's hard to see how it could be interpreted to mean ignore
} the (s.:.), even if there are double quotes.

I think this is fixed by workers/39019, but I did not add any tests that
use double-quoting.  Should there be some?
 
} To be clear: it is not a conflict that SHWORDSPLIT behaviour and
} (s...) behaviour differ from one another, e.g. with respect to forced
} [joining], only if expressions involving the same modifications to
} ${(@)x} and $@ differ when the contents of the arrays and the contexts
} are the same.

Agreed, but I'm still not sure the test suite covers that ...

} > Then there's this weird edge case, where an empty $IFS acts like you
} > have specified the (@) flag when shwordsplit is set:
} > 
} > torch% IFS=
} > torch% setopt shwordsplit
} > torch% print -l ${(s.:.)x}
} > a:b
} > c d
} > ef
} 
} Hmm... I would guess that what's happened is without an IFS forced
} joining with a default separator fails, and because it didn't get joined
} we refuse to split it

To clarify, the above edge case was introduced by the (never-committed)
patch in 39009, and should have been avoided by the patch in 39019.

} I would think the most logical answer here is it should have been joined
} with no separator and then split, but I doubt this has ever been thought
} about before.

This is still broken after 39019 (sigh) because IFS= plus shwordsplit
implies that joining should not happen in other circumstances, and we
only split after joining, so that unintentionally bleeds into this.  I
thought I'd got it worked out and that the tests I added covered it,
but trying this specific example again still fails.  Back to prodding
at it, I guess.

