Commit Graph

242 Commits (master)

Author SHA1 Message Date
Mikael Magnusson a66e929185 52878: Fix ${foo:^bar} where bar is an associative array 1 month ago
Bart Schaefer 76019f7174 52864: Change ${|var|...} to ${{var} ...}, limit local REPLY to ${|...} 2 months ago
Bart Schaefer 25182cc2e6 52759: ${ ... } trims one trailing newline; "${ ... }" preserves that newline. 2 months ago
Bart Schaefer 4fb96cc639 52612: %l replacment of zwarning() does literal string output 3 months ago
Bart Schaefer b3e763cc22 52482: strip trailing newlines in emulation modes of ${ command; } 4 months ago
Bart Schaefer fbec213cc5 52325: Clarify doc for edge cases of named references and nofork substitution
Unposted whitespace change avoids a parse error in ${ ... } with comments.
6 months ago
Bart Schaefer e6ad117ccb 52202: improve handling of quoting in ${var/pattern/replacement} 6 months ago
Oliver Kiddle 83f8a71a7c 52214: allow extra byte for nul terminator in allocation 7 months ago
Jun-ichi Takimoto 02e33c54d8 52169: a few more improvements of (#) flag
fix (#X) in C locale in FreeBSD, DragonFly, NetBSD.
Negative values such as ${(#X):--1} are now error.
UCS4 is limited to < 0x8000_0000 (in OSes without __STDC_ISO_10646__).
8 months ago
Bart Schaefer b357992697 52176: metafy return from ${ ... } substitution 8 months ago
Bart Schaefer 1becbba0b6 users/29160, workers/52156: Fix repetition of substitution modifier. 8 months ago
Bart Schaefer 3aaef16569 52154, 52155: Implement, document, and test non-forking command substitution.
Comprises workers/51957, 51985, 51987, 51988, 51993, 52131, 52139, plus
fixes for return values, parse errors, and trailing newlines (which were
incorrectly removed) in ${ ... }
8 months ago
Jun-ichi Takimoto 0eab788437 52122 + 52129: fix (#) parameter expansion flag
Without the X flag, null string "" is substituted for bad math expression.
8 months ago
Peter Stephenson 78102120b9 51816: add :S history modifier with pattern match 12 months ago
Bart Schaefer 0562be0af8 51509 (+ fix typo): Add ${(!)name} for the referred-to name of a named reference
Extend ${!name} in ksh emulation for same
1 year ago
Bart Schaefer a9ba166216 51483: Enable assignment and expansion of parameters with ksh-like namespace prefixes. 1 year ago
Bart Schaefer 511e020c68 51360: Initial implementation of named references. 1 year ago
Peter Stephenson d6b027c3c1 51350: ${(S)...//#%...} didn't match the whole string 1 year ago
Peter Stephenson 76d095df9d 51306: error message in ${unset?error} should be expanded 1 year ago
Oliver Kiddle 667ead3a64 51258, 51272: refactor handling of terminal attributes, removing OFF flags in zattr 1 year ago
Oliver Kiddle a73c705b0c 51212: remove STOUC() macro
This served as a workaround for ancient compilers where casts to
unsigned char were broken.
1 year ago
Jun-ichi Takimoto 8154ddc62d 49853 + 49882/49883: make "${arr[*]:off}" compatible with ksh/bash 2 years ago
Jun-ichi Takimoto 9b3a292410 49166: fix coredump in ${name:offset:length} with ill-formatted length 3 years ago
Peter Stephenson d293c12de6 49102: Ignore dynamic directory name failure if NO_EXEC 3 years ago
Bart Schaefer 82ff9f24f1 48560: add TYPESET_TO_UNSET option to remove initialization of parameters
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.
3 years ago
Daniel Shahaf 4ba9008ec7 48379: Make the parameter expansion subscript flags parse error message, "error in flags", identify the location of the parse error. 3 years ago
Bart Schaefer 04bd9a44a7 Unposted - fix comment 4 years ago
Bart Schaefer 63b6398b70 47364: Enable extendedglob in pattern with ${(*)name/pattern/replacement}
Mikael Magnusson: 47382: Completion for 47364
4 years ago
Peter Stephenson 4e0058afc5 users/24971: ${(-)var} sorts on signed integers 4 years ago
Peter Stephenson 7865486994 46100: Fix =subst before =(subst)
This occurs with SH file expansion ordering.

Add test.
4 years ago
Mikael Magnusson 817d461932 Support ${name:offset:length} with an empty offset 4 years ago
Daniel Shahaf 12414d8052 45583/0003: chrealpath: Let caller decide how the return value should be allocated. 4 years ago
Daniel Shahaf 38b0e1ff7e 45583/0002: chrealpath: Make symlink resolution optional. 4 years ago
Daniel Shahaf 8bc4400762 45058: internal: Add symbolic names to possible values of zexit()'s "from_where" parameter. No functional change. 4 years ago
Martijn Dekker c578f0a08b 45004: Fix typos in comments 5 years ago
Peter Stephenson b8dc5a7f6d 44435: Handling digita arguments for :h and :t.
Pick number of leading or trailing path components to substitute.
Active in history, brace parameters, glob qualifiers.

Add tests for all three environments.
5 years ago
Bart Schaefer c19a0927e1 43921: ${\var} should be an error 5 years ago
Peter Stephenson 50f8fa972c 43837 plus test from Daniel: Empty string in nested subst.
Skip Nularg or there is a bogus character at the start.
6 years ago
Peter Stephenson f99f7dca75 43616: Various parameter setting and display fixes.
Mostly to do with typeset -p and tied variables and their interaction.

Some general tied variable fixes.
6 years ago
Jun-ichi Takimoto baedd62f0d 43219 (except term{cap,info}.c): fix several memory leaks 6 years ago
Joey Pabalinas 110b13e109 42313: avoid null-pointer deref when using ${(PA)...} on an empty array result 6 years ago
Peter Stephenson b3fa5c528c 41877: Separate out SH_FILE_EXPANSION loop from parameter substitution.
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.
7 years ago
Barton E. Schaefer b84d69cf52 41828, 41830: skip SHFILEEXPANSION for new nodes added by stringsubst() in prefork() 7 years ago
Peter Stephenson 728f2adfc8 Add typeset -p1, like typeset -p with newlines 7 years ago
Peter Stephenson 6230e82d44 41764 (test tweaked): allow [key]+=value when modifying arrays 7 years ago
Peter Stephenson 7d4b41b52a 41747: Don't create hash entry if just checking existence.
Pass a flag in indicating this case.
7 years ago
Peter Stephenson 85b0dd7133 Updates for ksh array element syntax.
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.
7 years ago
Peter Stephenson e44600d9aa 41661: Need to remove tokens before using bufferwords() for (z) 7 years ago
Barton E. Schaefer 207263a61e 40929 (replaces 40598): paramsubst() should always return scalar when 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.
7 years ago
Barton E. Schaefer 420fc41b7c 40832: fix $x:P when PWD=/ 7 years ago