1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-01 09:41:44 +02:00
Commit graph

262 commits

Author SHA1 Message Date
Peter Stephenson
a32fb005d6 40486: Don't warn on creation of MATCH etc. in regex.
This because they are created implicitly rather than by explicit
user request, so the warning may not be useful.
2017-02-02 10:03:57 +00:00
Daniel Shahaf
ad1b46578e 40460: WARN_NESTED_VAR: Don't warn when assigning to a slice of an existing array 2017-02-01 01:49:45 +00:00
Peter Stephenson
1633b2800d 40423: WARN_NESTED_VARS, conversion the other way 2017-01-26 20:07:51 +00:00
Peter Stephenson
80e47a9a5d 40422: More WARN_NESTED_VAR cases.
Converting type when using a calling scope was broken in the
original patch.
2017-01-26 19:58:17 +00:00
Peter Stephenson
b3637caa90 40413: WARN_NESTED_VAR subscripted variable fix.
No warning needed on paramter that's created temporarily to
help assignment.
2017-01-25 09:35:30 +00:00
Peter Stephenson
c861b17bbf 40391: Add WARN_NESTED_VAR option and functions -W.
These are companions to WARN_CREATED_GLOBAL, warning when a variable
from an enclosing scope is altered.
2017-01-23 09:50:57 +00:00
Daniel Shahaf
9d87cd948e 40270 (after 39995): Add cross-reference for robustness. 2017-01-05 15:58:18 +00:00
Sebastian Gniazdowski
4fb4ce190c 40231: Optimise setarrvalue(). 2016-12-28 05:29:59 +00:00
Daniel Shahaf
334ed65e27 40068: Abort execution when setuid/setgid fail.
The incumbent code would print an error message and continue execution
with the previous uid/gid values, not even setting lastval:

    % UID=42 id -u; echo $?
    zsh: failed to change user ID: operation not permitted
    1000
    0
    %
2016-12-03 10:00:08 +00:00
Daniel Shahaf
fd2ca229dd 40067: internal: Document 'cmatcher', parse_cmatcher(), 'comptoend', unsetparam_pm(), and getindex(). 2016-12-03 09:54:11 +00:00
Barton E. Schaefer
a9fe87e18c 40032: consistency in handling of subscript slices outside the bounds of an array parameter
unposted: README: example describing 40032
2016-11-29 12:31:33 -08:00
Guillaume Maudoux
dae21874d4 39900: Add TERMINFO_DIRS special like TERMINFO.
Although this is a colon-separated array there is no tied array.
2016-11-20 20:24:15 +00:00
Peter Stephenson
368884a3aa 39995 (from 39977): Optimise string parameter assignment.
If setter is the standard one and string length is unchnaged we can
copy into place.
2016-11-20 19:41:52 +00:00
Daniel Shahaf
f35198d837 39992: setarrvalue: Allocate a correctly-sized array.
No memory was lost; the array was allocated with room for one (char *) element
more than was required.
2016-11-20 11:56:02 +00:00
Jun-ichi Takimoto
3fd50d06a1 39937: fix a problem introduced by 39886.
$a[i,j] should become an empty array if i>j.
2016-11-15 00:17:35 +09:00
Barton E. Schaefer
d676d1bf4b 39893: use arrdup_max() to show explicitly the difference in two code branches
no functional change
2016-11-10 21:01:32 -08:00
Daniel Shahaf
7139b73724 39874/0001: setarrvalue: Remove needless initialization. 2016-11-11 04:35:41 +00:00
Peter Stephenson
65ea1a033b 39887: no need to conditionalise assignment of strlen() 2016-11-09 13:45:11 +00:00
Peter Stephenson
a1633e09a7 39886 based on 39877: Optimise arrdup to arrdup_max.
Only duplicate as much of the array as is needed.
2016-11-09 11:54:57 +00:00
Sebastian Gniazdowski
49407686b4 39875: add dupstring_glen to avoid redundant strlen calls 2016-11-09 10:32:48 +00:00
Sebastian Gniazdowski
06e4ec853a 39871: cut down number of strlen()s in getstrvalue() 2016-11-08 15:14:08 +00:00
Sebastian Gniazdowski
68a576bc55 39869: can transfer ownership of core of array when assigning 2016-11-08 10:49:13 +00:00
Barton E. Schaefer
ab81b98c49 39758: revise 39704 for array and hash parameters; more POSIXBUITINS tweaks for
export

39704 was commit 0f5e670, forgot to reference article number in that log.

"typeset -p" outputs "typeset" for array and hash parameters, even when
exported, because those types can be marked export but are never pushed
to the enviroment.

For POSIXBUILTINS, "export var" does not implicitly set $var, and its
export state is preserved when assigned (but not when explicitly unset).
2016-10-29 11:56:50 -07:00
Barton E. Schaefer
0f5e670cde "typeset -p" uses "export" commands or the "-g" option for parameters that are not local to the current scope 2016-10-24 07:14:39 -07:00
Peter Stephenson
4ab3fcc90d 39545: Add some missing unqueue_signals().
All of these are added simply to fit existing logic in other branches.
2016-10-03 13:43:20 +01:00
Peter Stephenson
c942c7e8b6 39519: restore missing PM_EXPORT flags.
This was missing when exporting using USE_SET_UNSET_ENV coce variant.
2016-09-30 11:35:50 +01:00
Peter Stephenson
d08674ef8c 39498: use PRIVILEGED option to decide on problematic parameter imports 2016-09-30 10:41:44 +01:00
Bart Schaefer
d44d23c757 unposted: change '\0' to NULL to silence spurious compile warning.
params.c:830:13: warning: expression which evaluates to zero treated as a null
      pointer constant of type 'char *' [-Wnon-literal-null-conversion]
    *envp = '\0';
2016-09-28 10:58:46 -07:00
Peter Stephenson
b32d974000 39460: Don't import PS4 if running as root.
There was an exploit in bash using SHELLOPTS to turn on xtrace,
however this can't happen in zsh, so this is simply a precaution.
2016-09-28 09:50:58 +01:00
Oliver Kiddle
fbafc5b509 39332: support ksh's [[ -v varname ]] condition for checking if variables are set 2016-09-16 00:00:28 +02:00
Daniel Shahaf
7154052ebe 39046 + 39061: New :P history modifier. 2016-08-22 03:34:30 +00:00
Daniel Shahaf
f9b1703511 38971: Start using the new arrlen_ge() / arrlen_le() helpers. 2016-08-01 08:01:29 +00:00
Daniel Shahaf
1a368bf31f 38973: Optimize indexing array parameters.
% () { for 1 in $prefix/zsh/bin/zsh Src/zsh; do $1 -f -c 'a=( {1..1000000} ); repeat 3 time ( repeat 300 : $a[1]  )'; done }
( repeat 300; do; : $a[1]; done; )  1.68s user 0.01s system 98% cpu 1.718 total
( repeat 300; do; : $a[1]; done; )  1.69s user 0.01s system 99% cpu 1.710 total
( repeat 300; do; : $a[1]; done; )  1.69s user 0.01s system 99% cpu 1.714 total

( repeat 300; do; : $a[1]; done; )  0.00s user 0.01s system 72% cpu 0.022 total
( repeat 300; do; : $a[1]; done; )  0.00s user 0.01s system 72% cpu 0.022 total
( repeat 300; do; : $a[1]; done; )  0.01s user 0.01s system 69% cpu 0.023 total
2016-08-01 08:01:28 +00:00
Peter Stephenson
d309d9addc 38692: IFS can't be changed in restricted mode 2016-06-21 12:32:27 +01:00
Barton E. Schaefer
3a6a6fda8a unposted (cf. 38612): remove overeager DPUTS() 2016-06-04 22:21:29 -07:00
Greg Klanderman
440c6beec0 38086: shuffle init code to localize a global, add $ZSH_ARGZERO, refine $ZSH_SCRIPT
(also a couple of ChangeLog typos corrected -- Bart)
2016-03-06 09:53:40 -08:00
Stephane Chazelas
f7d5ff31ce 38020: fix problems with $SECONDS.
Fractions of a second were not handled correctly.
2016-02-26 11:12:32 +00:00
Barton E. Schaefer
b7b3ae311d 37988: $0 becomes read-only under POSIXARGZERO 2016-02-17 20:04:25 -08:00
Peter Stephenson
1ab316c9b8 37895: $ZSH_SCRIPT is POSIX $0 but always availble 2016-02-07 21:01:08 +00:00
Jun-ichi Takimoto
a4020e10a3 37868: add 'static' to file local variables 2016-02-03 01:25:33 +09:00
Barton E. Schaefer
10c5f95f52 37785: skip autoload parameters for "typeset -p" 2016-01-26 18:17:24 -08:00
Peter Stephenson
da71967273 37512: overeager WARN_CREATE_GLOBAL with strftime 2016-01-15 12:16:40 +00:00
Peter Stephenson
524f802610 37489, tweaked: with POSIX_IDENTIFIERS create math var as scalar 2016-01-03 18:57:10 +00:00
Peter Stephenson
16684952fb 37305: typeset -p can now output arrays on one line 2015-12-04 15:39:53 +00:00
Peter Stephenson
e40a14c5e4 37202: suppress WARN_CREATE_GLOBAL warnings after a fork 2015-12-04 10:44:33 +00:00
Daniel Shahaf
5ecf332e84 37253: Constify two local variables. 2015-12-03 23:53:03 +00:00
Daniel Shahaf
4202c90b6d 37254: No functional change: change code layout in preparation for 37253. 2015-11-30 03:42:46 +00:00
Daniel Shahaf
503fa5cd9e 37250: No functional change: rename local variables. 2015-11-30 03:42:45 +00:00
Barton E. Schaefer
9e06828a7f 37208: check for restricted parameter before changing from unset to set
Also, return NULL from setnparam() on failure to retrieve value (avoids
null-pointer dereference); add some expository comments
2015-11-23 21:48:49 -08:00
Peter Stephenson
58d040fd85 37203: WARN_CREATE_GLOBAL test in wrong place for associative array 2015-11-23 15:50:13 +00:00