Commit graph

1246 commits

Author SHA1 Message Date
Bart Schaefer 25182cc2e6 52759: ${ ... } trims one trailing newline; "${ ... }" preserves that newline. 2024-03-17 14:28:28 -07:00
Bart Schaefer 326e8635fe 52752: typeset -p fixes for local exports and "export -x" / "readonly -r" output. 2024-03-14 13:11:31 -07:00
Bart Schaefer 330821de01 52692: local typeset of the name of a named reference hides the reference 2024-03-05 21:13:33 -08:00
Bart Schaefer 0848b7534e 52659: Fix crash on unset-through-nameref, add regression test 2024-03-04 21:21:20 -08:00
Bart Schaefer 700f675bf0 Add missing test case from 52652 2024-03-04 21:15:29 -08:00
Bart Schaefer 610b18875a 52650 plus minor fixes: add -u for named references pointing to "upper" scope 2024-03-04 21:07:01 -08:00
midchildan 36a2d5cfa4 52641: incarg: add a backward variant and make it repeatable 2024-03-05 00:05:21 +01:00
Jun. T 145397b6dc 52635: show file name when test has crashed 2024-03-02 20:26:01 -08:00
Bart Schaefer 85172998f4 52619 (plus tests): no empty element when appending array to unset scalar 2024-02-28 20:40:26 -08:00
Bart Schaefer 4b9cd6b8bd 52583: extra check for proper scope and existence of readonly specials 2024-02-23 09:51:06 -08:00
Bart Schaefer 6b21e5c0e2 52559: revise "typeset -p" with respect to local readonly special parameters
Update doc and tests to describe handling of global readonly specials and
to account for side-effects on zsh/param/private.
2024-02-20 20:16:03 -08:00
Bart Schaefer c2cf21c8f0 Merge branch 'master' of git://git.code.sf.net/p/zsh/code 2024-02-18 10:32:07 -08:00
Bart Schaefer 00b12da9c0 52556: regression test for unset referent (left out of last commit) 2024-02-18 10:31:21 -08:00
Stephane Chazelas b3cad1c24c 52515: (+ tests in 52527) avoid sh errors when running shebang-less scripts with paths starting with - or + 2024-02-18 18:22:37 +00:00
midchildan fb9a7cc5dd 52520: add new features and improvements to the "incarg" ZLE widget
- Decrement integers without defining a new widget
- Preserve the number of leading zeros
- Increment binaries, octals, and hexadecimals
- Move the cursor to the end of the incremented integer
- Create a sequence of integers across terminal panes
- Add a Vim variant
- Also add tests
2024-02-15 15:40:37 +01:00
Bart Schaefer 8801665e5b 52513: fixes and doc for using nofork substitutions with private parameters
Also fixes a crash bug with {fd}>&N redirections and private parameters
2024-02-03 12:07:14 -08:00
Oliver Kiddle 698af7bc13 52405, 52502: add empty elements to $match for optional captures that don't match 2024-01-26 07:33:38 +01:00
Bart Schaefer 1a3ebb68d6 52385: avoid "tr" in test output formatting 2024-01-25 21:58:25 -08:00
Oliver Kiddle 10c3ed20c7 52393: fix tests on Solaris by omitting -a option to diff as it is not supported there 2023-12-13 11:40:03 +01:00
Bart Schaefer 1ba0fff93c 52360: simplify and improve bad-descriptor detection in %prep section 2023-12-02 15:14:12 -08:00
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.
2023-11-23 13:23:55 -08:00
Bart Schaefer e6ad117ccb 52202: improve handling of quoting in ${var/pattern/replacement} 2023-11-15 20:16:04 -08:00
Jun-ichi Takimoto 1b8446e1cd 52188: skip tests that fail if multibyte is not available 2023-09-27 23:45:00 +09:00
Bart Schaefer 1becbba0b6 users/29160, workers/52156: Fix repetition of substitution modifier. 2023-09-16 20:51:27 -07:00
Bart Schaefer 293d36ae1e 52155: Test file missed out from previous commit 2023-09-16 20:03:32 -07:00
Jun-ichi Takimoto 0eab788437 52122 + 52129: fix (#) parameter expansion flag
Without the X flag, null string "" is substituted for bad math expression.
2023-09-13 09:59:42 +09:00
Bart Schaefer e3c2af216b 52115: permit repeated "private" declarations as long as types aren't changed 2023-09-05 18:04:09 -07:00
Bart Schaefer 9ff1b2810e users/29220: fix bug with assignment to private following explicit unset 2023-09-03 11:42:00 -07:00
Peter Stephenson aa8e4a0290 52008: Pattern bug with branches + exclusion
Add tests.
2023-08-01 14:32:55 +01:00
Bart Schaefer baa19d2a85 51945: assorted documentation improvements, bug fixes, and new test
1) Document the behavior of "typeset -n existing_var" (via Jun T. comment)
2) Prohibit "typeset -nm pattern" because, well, it's insane.  Add test.
3) Improve doc for ${(!)ref} including ${{t!)ref} (Jun T.)
4) Fix doc for how-to unset of a named ref (Jun T.)
5) Allow "typeset +r -n ref" and "typeset +r +n ref" (Jun T.)
6) Fix "typeset -r -n ref=param" to create readonly references
7) Avoid accidental removal of PM_UNSET flag (Jun T.) and update test
8) Fix "typeset -gn ref=value" and add a test for it
9) Add tests for read-only reference behavior
10) Fix infinite recursion when resolving scope of an unset local
named reference, add test.
2023-07-26 20:15:21 -07:00
Peter Stephenson 03695f4b58 51977: PIPEFAIL interaction with ERREXIT / ERRRETURN
Ensure the list-level error handling code is executed if we detect pipe failure for a foreground job.

Add tests.
2023-07-20 10:46:14 +01:00
Jun-ichi Takimoto 1b9bc3441c 51884: reset IFS if it contains invalid characters
This happens only if MULTIBYTE option is on.
2023-06-26 16:52:40 +09:00
Bart Schaefer 4345eed1fe 51887: namespaces recognized in math, incorrect usages rejected. 2023-06-22 13:36:40 -07:00
Marlon Richert 6c993144bd 51860: simplify suffix handling in _prefix to remove less accurate hack
This solves the following problems in the _prefix completer:
- The old code had logic for dealing with compstate[unambiguous] that
  was unnecessary. It works fine without it.
- Because of this logic, if a widget set compstate[insert]=1 after
  calling _main_complete, an `x` was left after the completion on the
  command line.
- If the same widget also set `compstate[to_end]=`, then instead, the
  last character of the inserted completion would be treated as an
  autoremovable suffix, with the actual suffix being inserted to the
  line as a normal character.
- After inserting a completion, the cursor would move to the end of the
  entire current word on the command, not the end of word that was
  inserted. This is not what you want with _prefix, since you are trying
  to complete a word _before_ the one on the command line, after which
  you usually want to insert a separator, such as a space or slash,
  before the next word.
2023-06-22 13:13:09 -07:00
Peter Stephenson 78102120b9 51816: add :S history modifier with pattern match 2023-06-06 09:16:46 +01:00
Marlon Richert 63400fdbc5 51779: update completion test for 51761 2023-06-06 11:03:09 +09:00
Marlon Richert caa1c38c6f 51348: Fix subscript completion bugs inside ~[...]
When completing inside ~[...] (_with_ the trailing `]` present), the
following bugs occured:
- Subscript completion was skipped entirely when there were one or more
  slashes ('/') in the subscript, which is incorrect, since slashes are
  allowed there.
- Instead of going through _complete, $_comps[-subscript-] was called
  immediately, causing _setup to be skipped.
- If succesful, _main_complete was exited right after, causing
  menu-style, comppostfuncs and other essential completion features to
  be skipped.
2023-05-21 03:24:17 +02:00
Marlon Richert bb441f77a7 51758: Make dynamic dir completion easier to implement 2023-05-21 03:05:20 +02:00
Oliver Kiddle b4d1c756f5 51738: support pcre's alternative DFA matching algorithm 2023-05-13 00:59:00 +02:00
Oliver Kiddle f3f371deb3 51728: assign pcre named capture groups to a hash 2023-05-13 00:56:48 +02:00
Oliver Kiddle b62e911341 51723: migrate pcre module to pcre2 2023-05-13 00:53:32 +02:00
Jun-ichi Takimoto 7f2bdf55a3 51692: not skip tests for [[ -r/-N file ]] on Cygwin 2023-05-08 12:53:37 +09:00
Peter Stephenson 8f5fe841a6 51652: fix running of TRAPEXIT explicitly.
This is a special case where TRAPEXIT is unset within a TRAPEXIT
as it should never run in a nested context, so just save the
function structure temporarily on the heap.
2023-04-17 09:30:34 +01:00
Peter Stephenson 12e5db145b 51608: Don't execute commands after "continue &&"
Also ! continue ||
2023-03-29 10:52:05 +01:00
Bart Schaefer 8d009d35a9 51510: Skip namespaces in "set"/"typeset" output, add tests, fix bug 2023-03-06 20:01:04 -08:00
Bart Schaefer 32cceefa95 51437: Fix incorrectly-passed test case, masked by unrelated bug.
A bug with zmodload when unloading/reloading a static module caused the
state of the shell options to change during K01 test.  Worked around it.
Also changed warnnestedvar messages to look more like other such.
2023-02-14 17:54:42 -08:00
Peter Stephenson 7e0c4406ce 51424: $(<...) shouldn't try to open a file with NO_EXEC 2023-02-14 09:21:32 +00:00
Bart Schaefer 03887bb03f 51430: Misc. problems with typeset and $parameters
* Fix and test for regression of assignment when using typeset command
* Fix output of typeset +m and $parameters[ref]
* Prevent segfault in typeset
2023-02-13 18:20:11 -08:00
Bart Schaefer f4c706f0c8 51417: Check subscripts in named reference values more rigorously. 2023-02-12 12:20:33 -08:00
Bart Schaefer acb15e3cc9 51403: Tests and documentation for 51402, clean up some other tests. 2023-02-12 11:57:31 -08:00