summaryrefslogtreecommitdiff
path: root/Src/subst.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-1051258, 51272: refactor handling of terminal attributes, removing OFF flags ↵Oliver Kiddle1-2/+9
in zattr
2022-12-1651212: remove STOUC() macroOliver Kiddle1-3/+3
This served as a workaround for ancient compilers where casts to unsigned char were broken.
2022-03-2949853 + 49882/49883: make "${arr[*]:off}" compatible with ksh/bashJun-ichi Takimoto1-3/+18
2021-07-1949166: fix coredump in ${name:offset:length} with ill-formatted lengthJun-ichi Takimoto1-5/+7
2021-06-2849102: Ignore dynamic directory name failure if NO_EXECPeter Stephenson1-1/+1
2021-04-1848560: add TYPESET_TO_UNSET option to remove initialization of parametersBart Schaefer1-1/+2
Changes typeset such that ${newparam-notset} yields "notset" and "typeset -p newparam" does not show an assignment to the parameter. This is similar to the default behavior of bash and ksh, with minor differences in typeset output. Also add tests for some POSIX incompatibilities plus minor changes for test harness robustness.
2021-04-0848379: Make the parameter expansion subscript flags parse error message, ↵Daniel Shahaf1-3/+25
"error in flags", identify the location of the parse error.
2020-09-13Unposted - fix commentBart Schaefer1-1/+1
2020-09-1347364: Enable extendedglob in pattern with ${(*)name/pattern/replacement}Bart Schaefer1-4/+15
Mikael Magnusson: 47382: Completion for 47364
2020-07-03users/24971: ${(-)var} sorts on signed integersPeter Stephenson1-0/+4
2020-06-2646100: Fix =subst before =(subst)Peter Stephenson1-1/+1
This occurs with SH file expansion ordering. Add test.
2020-05-12Support ${name:offset:length} with an empty offsetMikael Magnusson1-5/+15
2020-03-2545583/0003: chrealpath: Let caller decide how the return value should be ↵Daniel Shahaf1-2/+2
allocated.
2020-03-2545583/0002: chrealpath: Make symlink resolution optional.Daniel Shahaf1-2/+2
2019-12-1745058: internal: Add symbolic names to possible values of zexit()'s ↵Daniel Shahaf1-1/+1
"from_where" parameter. No functional change.
2019-12-1145004: Fix typos in commentsMartijn Dekker1-6/+6
2019-06-2044435: Handling digita arguments for :h and :t.Peter Stephenson1-10/+27
Pick number of leading or trailing path components to substitute. Active in history, brace parameters, glob qualifiers. Add tests for all three environments.
2018-12-2143921: ${\var} should be an errorBart Schaefer1-1/+1
2018-11-2143837 plus test from Daniel: Empty string in nested subst.Peter Stephenson1-0/+2
Skip Nularg or there is a bogus character at the start.
2018-10-0843616: Various parameter setting and display fixes.Peter Stephenson1-2/+2
Mostly to do with typeset -p and tied variables and their interaction. Some general tied variable fixes.
2018-07-3143219 (except term{cap,info}.c): fix several memory leaksJun-ichi Takimoto1-1/+1
2018-01-2342313: avoid null-pointer deref when using ${(PA)...} on an empty array resultJoey Pabalinas1-1/+1
2017-10-1341877: Separate out SH_FILE_EXPANSION loop from parameter substitution.Peter Stephenson1-16/+23
Parameter substitution can add nodes that need to be rescanned by it, but not by file expansion, so the two don't play well together.
2017-10-0841828, 41830: skip SHFILEEXPANSION for new nodes added by stringsubst() in ↵Barton E. Schaefer1-2/+17
prefork()
2017-10-01Add typeset -p1, like typeset -p with newlinesPeter Stephenson1-1/+3
2017-09-2741764 (test tweaked): allow [key]+=value when modifying arraysPeter Stephenson1-4/+13
2017-09-2541747: Don't create hash entry if just checking existence.Peter Stephenson1-4/+8
Pass a flag in indicating this case.
2017-09-24Updates for ksh array element syntax.Peter Stephenson1-7/+64
Move detection of key/value pairs down into prefork(). Detect normal array assignment and [key]=val array assignemnt separately. Mark key / value pairs with Marker and pass up flag. Deal with marked triads specially later on.
2017-09-1041661: Need to remove tokens before using bufferwords() for (z)Peter Stephenson1-2/+6
2017-04-0240929 (replaces 40598): paramsubst() should always return scalar when ↵Barton E. Schaefer1-13/+8
PREFORK_SINGLE was passed in from prefork() Previous commit (74fe4d09) consumed too much of the input linked list, leading to later expansions being skipped. This commit converts from array to string sooner, but may thereby alter rc_expand_param and array element uniqueness behavior.
2017-03-1140832: fix $x:P when PWD=/Barton E. Schaefer1-2/+10
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