zsh-workers
 help / color / mirror / code / Atom feed
* Arith expansion accepts extra closing parenthesis
@ 2015-06-01 16:32 Martijn Dekker
  2015-06-02  8:56 ` Peter Stephenson
  2015-06-02 17:58 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: Martijn Dekker @ 2015-06-01 16:32 UTC (permalink / raw)
  To: zsh-workers

I just found some more arithmetic parsing strangeness. zsh 5.0.8 and
4.3.11 both happily accept and ignore one (1) extra closing parenthesis
in variable expansion within arithmetic expansion (even in POSIX mode).

% X='1)'
% echo $(($X))
1
% echo $((X))
1

(Expected output: error message in both cases)

Yet, 'echo $((1)))' errors out as expected, as do 'echo $(($X))' and
'echo $((X))' for X='1))', X='1)))', X='(1', etc.

- Martijn


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-02 18:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-01 16:32 Arith expansion accepts extra closing parenthesis Martijn Dekker
2015-06-02  8:56 ` Peter Stephenson
2015-06-02  9:14   ` Peter Stephenson
2015-06-02 17:58 ` Bart Schaefer
2015-06-02 18:10   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).