Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: safe numeric import



On Mon, 29 Sep 2014 11:04:20 +0100
Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> OK, how about this?  When we're doing the import, all numbers, integer
> or floating point, are imported straight, without an evaluation.

Here's a test --- I confirmed this does wayward things with old
versions of the shell.

diff --git a/Test/C01arith.ztst b/Test/C01arith.ztst
index 25cd8b8..4c55b96 100644
--- a/Test/C01arith.ztst
+++ b/Test/C01arith.ztst
@@ -282,3 +282,7 @@
   print $(( [#_] (5. ** 10) / 16. ))
 0:Grouping output with underscores: floating point
 >610_351.562_5
+
+  env SHLVL=1+RANDOM $ZTST_testdir/../Src/zsh -f -c 'print $SHLVL'
+0:Imported integer functions are not evaluated
+>2

pws



Messages sorted by: Reverse Date, Date, Thread, Author