summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
Diffstat (limited to 'README')
-rw-r--r--README102
1 files changed, 92 insertions, 10 deletions
diff --git a/README b/README
index e3ccc70b1..142daadf1 100644
--- a/README
+++ b/README
@@ -5,16 +5,11 @@ THE Z SHELL (ZSH)
Version
-------
-This is version 5.0.7 of the shell. This is a stable release.
-There are minor new features as well as bug fixes since 5.0.6.
-
-Note in particular there is a security fix to disallow evaluation of the
-initial values of integer variables imported from the environment (they
-are instead treated as literal numbers). That could allow local
-privilege escalation, under some specific and atypical conditions where
-zsh is being invoked in privilege elevation contexts when the
-environment has not been properly sanitized, such as when zsh is invoked
-by sudo on systems where "env_reset" has been disabled.
+This is version 5.0.8 of the shell. This is a stable release.
+There are no significant new features since 5.0.7, but there
+are many bugfixes and some significant internal improvements, notably
+a more predictable effect for keyboard interrupts and proper parsing
+of $(...) expressions.
Installing Zsh
--------------
@@ -35,6 +30,93 @@ Zsh is a shell with lots of features. For a list of some of these, see the
file FEATURES, and for the latest changes see NEWS. For more
details, see the documentation.
+Incompatibilites between 5.0.7 and 5.0.8
+----------------------------------------
+
+Various arithmetic operations have changed, in particular with respect
+to the choice of integer or floating point operations. The new
+behaviour is intended to be more consistent, but is not compatible with
+the old.
+
+1) Previously, the modulus operation, `%', implicitly converted the
+operation to integer and output an integer result, even if one
+or both of the arguments were floating point. Now, the C math
+library fmod() operator is used to implement the operation where
+one of the arguments is floating point. For example:
+
+Old behavour:
+
+% print $(( 5.5 % 2 ))
+1
+
+New behaviour:
+
+% print $(( 5.5 % 2 ))
+1.5
+
+
+2) Previously, assignments to variables assigned the correct type to
+variables declared as floating point or integer, but this type was
+not propagated to the value of the expression, as a C programmer
+would naturally expect. Now, the type of the variable is propagated
+so long as the variable is declared as a numeric type (however this
+happened, e.g. the variable may have been implicitly typed by a
+previous assignment). For example:
+
+Old behaviour:
+
+% integer var
+% print $(( var = 5.5 / 2.0 ))
+2.75
+% print $var
+2
+
+New behaviour:
+
+% integer var
+% print $(( var = 5.5 / 2.0 ))
+2
+% print $var
+2
+
+
+3) Previously, the FORCE_FLOAT option only forced the use of floating
+point in arithmetic expressions for integer constants, i.e. numbers
+typed directly into the expression, but not for variables. Hence
+an operation involving only integer variables (or string variables
+containing integers) was not forced to be performed with floating point
+arithmetic. Now, operations involving variables are also forced to
+floating point. For example:
+
+Old behaviour:
+
+% unsetopt FORCE_FLOAT
+% print $(( 1 / 2 ))
+0
+% integer i=1 j=2
+% print $(( i / j ))
+0
+% setopt FORCE_FLOAT
+% print $(( 1 / 2 ))
+0.5
+% print $(( i / j ))
+0
+
+New behaviour:
+
+% unsetopt FORCE_FLOAT
+% print $(( 1 / 2 ))
+0
+% integer i=1 j=2
+% print $(( i / j ))
+0
+% setopt FORCE_FLOAT
+% print $(( 1 / 2 ))
+0.5
+% print $(( i / j ))
+0.5
+
+
Incompatibilities between 5.0.2 and 5.0.5
-----------------------------------------