summaryrefslogtreecommitdiff
path: root/Src/subst.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-0740760: Always tokenize unquoted - to Dash.Peter Stephenson1-17/+24
This fixes use of pattern match character ranges in unusual contexts. Attempt to detect a tokenized - in cases where we don't care.
2017-02-2540640: the (A) parameter flag forces array result even if assignment syntax ↵Barton E. Schaefer1-0/+11
is not used
2017-02-2040598: paramsubst() should always return scalar when PREFORK_SINGLE was passedBarton E. Schaefer1-1/+14
2017-02-2040593: SHWORDSPLIT + unset IFS should cause default splitting of $@Barton E. Schaefer1-1/+2
2017-01-1840375: autoload with explicit path mustn't trash already loaded function.Peter Stephenson1-4/+4
Also remove unnecessary dupstring() on already duplicated string when expanding =cmd.
2017-01-03users/22319: ${ary1:^ary2} should not change isarr state of expansion of ary1Barton E. Schaefer1-2/+4
Unless ary1 is made from a scalar, semantics of (@) in double quotes is lost.
2016-12-0340071: change Dash back to "-" before evaluating named directory expansionsBarton E. Schaefer1-0/+2
2016-11-2940034: clear badcshglob when ignoring errorsBarton E. Schaefer1-1/+3
2016-11-2940035: Cosmetic fixes for comments and documentation.Eitan Adler1-1/+1
Mostly fixes to doubled words.
2016-11-1539949: Special case for "-" in directory names.Peter Stephenson1-8/+8
It can be sh-tokenized to Dash to allow for appearing in ranges after substitution, so needs to be turned back to "-" in that case.
2016-10-0639579: Fix string calculation for parameter quoting.Julien Cretin1-3/+3
Where there was no closing quote the size or position of the null could be wrongly calculated.
2016-09-2934943: Fixes for "command" with multiple options.Peter Stephenson1-1/+1
These need to combine properly, and alos "command -p" with either -v or -V needs to search for builtins and then using the default system path.
2016-09-14zsh-users/21903: Fix ${...?...} in interactive shell.Peter Stephenson1-0/+7
On failure should abort back to top level, but we reset the error flag around commands. Add a hard error flag that's only reset at top level.
2016-09-1139252: internal: quotestring: Drop the 'e' parameter, which no caller uses.Daniel Shahaf1-6/+6
2016-08-2939115: repair forced joining when (@) and (j) are used togetherBarton E. Schaefer1-2/+3
2016-08-2239046 + 39061: New :P history modifier.Daniel Shahaf1-0/+13
2016-08-1239035: ${(A)name=word} should expand as an array even when there is only one ↵Barton E. Schaefer1-0/+1
element.
2016-08-1239028: more join/split cases fixed and tested.Barton E. Schaefer1-3/+4
2016-08-1039019 (cf. PWS 39013): fix SHWORDSPLIT regression introduced by workers/29313Barton E. Schaefer1-6/+15
Also add test cases for more join/split combinations
2016-08-0138973: Optimize indexing array parameters.Daniel Shahaf1-4/+11
% () { 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-06-0438599: skip the "no such named directory" warning when NO_EXEC is in effectBarton E. Schaefer1-1/+1
2016-06-03unposted: internal: Document modify().Daniel Shahaf1-0/+13
2016-03-07users/21352: ensure $'' doesn't get elided.Peter Stephenson1-1/+5
Assign nulstring to it if empty. Test for all forms of quotation marks.
2015-12-0737344: restore old printable quoting, add ${(q+)...}.Peter Stephenson1-4/+10
The \C- form is only used inside quotedzputs(). ${(q+)...} outputs a quotedzputs() representation.
2015-11-2337206: fix ${(t)param} for "typeset -H param"Barton E. Schaefer1-1/+1
2015-11-1237096: Another $${(P)...} tweak.Peter Stephenson1-2/+17
Make a top level (P) work with nested ones, i.e. ${(P)${(P)...}...}
2015-11-1137094: Further tweaks to parameter name references.Peter Stephenson1-3/+3
Safety in array test. Make nested references work. Add parameter tests.
2015-11-1137092: make nested ${(P)name} properly refer to parameter on returnPeter Stephenson1-44/+70
2015-11-0737074: extend previous fix to over whitespace at endPeter Stephenson1-14/+36
2015-11-0637073: another SH_WORD_SPLIT problem.Peter Stephenson1-6/+34
In cases like x${:- y} the space was simply removed instead of being used for splitting.
2015-07-0635694: fix handling of history modifiers applied across all elements of an ↵Barton E. Schaefer1-2/+8
array parameter value
2015-05-3135343: Avoid $#name length handling for POSIX_IDENTIFIERSPeter Stephenson1-1/+2
2015-05-2935326: $#- was misparsed as ${#-}Peter Stephenson1-1/+1
2015-05-1535153: nested math substitutionPeter Stephenson1-2/+11
2015-05-1535151: improved check for parameter q and b flagsPeter Stephenson1-1/+2
2015-05-1035067: Add (b) parameter flag for pattern char backslashing.Peter Stephenson1-2/+11
Doc tweak from Daniel in 35071. Includes test.
2015-02-2234606: fix up nested arithmetic substitutionPeter Stephenson1-2/+18
Arithmetic within a parameter substitution is a special case that needs fixing with the introduction of the new Inparmath token. Add test.
2015-02-1934573: Safer failure to handle command substitutionPeter Stephenson1-3/+7
2015-02-1934570: Another nasty command / math substituion thing.Peter Stephenson1-11/+17
Mark arithmetic substitutions with tokens to make sure the substitution go knows what to do. Before it was guessing by counting the parentheses at the end.
2015-01-1834322: bug with interface to parsestr() etc.Peter Stephenson1-3/+5
Was showing up in places like ${(e)...} where command substitution could reallocate the token string, but actually there was never any guarantee that the lexer wouldn't do that, so this was always a bit iffy.
2015-01-0634105: subst: remove dead codeMikael Magnusson1-1/+1
Found by Coverity (Issue 1255810).
2015-01-0634103: fix ancient double-quote handling thinko in subst_parse_str()Barton E. Schaefer1-2/+4
This doesn't seem to have mattered, but must in some obscure cases
2014-12-1533976: fix overlapping strcpy()Barton E. Schaefer1-1/+1
2014-12-1133876: etc.: Separate errors and keyboards interruptsPeter Stephenson1-9/+18
Combination of 12 commits from interrupt_abort branch. Basic strategy is to introduce bits to errflag and to set and reset them separately. Remove interrupt status on return to main keymap. Turn off ERRFLAG_INT for always block. Restore bit thereafter: we probably need a new variable in order to allow user interrupts to be reset in the always block. Add TRY_BLOCK_INTERRUPT This works the same as TRY_BLOCK_ERROR, but for a SIGINT, too. Ensure propagation of SIGINT from exited job. If received by foreground job, shell uses ERRFLAG_INT, not ERRFLAG_ERROR, to set the new state. Reset errflag before precmd() Add always block in _main_completion to fix ZLS_COLORS Ensures we get the right state of $ZLS_COLORS at the end of _main_complete even if there's an interrupt. However, the "right state" is a bit messy as it depends on styles.
2014-10-1233423: expand ${(p)...} to allow ${(ps.$param.)...}Peter Stephenson1-5/+16
2014-09-0633118: record original param unset state when treating empty the same as unset,Barton E. Schaefer1-6/+9
to avoid incorrect NO_UNSET errors
2014-08-04unposted: remove unused variablesPeter Stephenson1-1/+1
2014-08-0432949 (wip 32928, 32937): Add :^ syntax for zipping two arraysMikael Magnusson1-0/+61
2014-08-0132932: add hmkarray() and use to fix leakPeter Stephenson1-1/+1
2014-04-1832552 (updated by 32560): fix segfault when using process substitution in ↵Andrew Waldron1-1/+1
anonymous function argument list Also disallow process substitution in function name position.