1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-06-03 05:46:03 +02:00
Commit Graph

72 Commits

Author SHA1 Message Date
Bart Schaefer 1becbba0b6 users/29160, workers/52156: Fix repetition of substitution modifier. 2023-09-16 20:51:27 -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
Peter Stephenson 7e0c4406ce 51424: $(<...) shouldn't try to open a file with NO_EXEC 2023-02-14 09:21:32 +00:00
Jun-ichi Takimoto 4fc5dc0292 50629: do not use egrep in tests 2022-09-15 18:56:20 +09:00
Bart Schaefer 23dab58b8e Fix problems with tests for 50126 and 50150. 2022-05-02 20:31:47 -07:00
Bart Schaefer 8fac1b7c62 50160: Regression tests for 50126, 50136, and 50149 2022-05-01 12:17:33 -07:00
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.
2021-04-18 13:58:09 -07:00
Jun-ichi Takimoto 6e20f0e3d1 47849: do not skip tests requiring zpty on Cygwin 2021-01-20 13:49:42 +09:00
Daniel Shahaf 03407c2928 46204: Fix new test case for the theoretical case of having more than 100 files in the root directory. 2020-07-12 11:37:16 +00:00
Jun-ichi Takimoto c04a391877 46215: make the test for RM_STAR_SILENT work on wider systems 2020-07-09 19:06:07 +09:00
Daniel Shahaf cf134c15a0 46175/0003: Fix the RM_STAR_SILENT bug from the parent commit. 2020-07-05 11:11:59 +00:00
Daniel Shahaf b58141c4cf 46175/0002: Add a regression test for 46169: the RM_STAR_SILENT logic processes the current directory rather than the root directory.
The bug will be fixed in the next commit.
2020-07-05 11:11:59 +00:00
Daniel Shahaf d1b4e60ff5 46175/0001: Add a unit test for the RM_STAR_SILENT option. 2020-07-05 11:11:59 +00:00
Mikael Magnusson 8923d2a618 Add SHORT_REPEAT option 2020-04-02 07:42:16 +02:00
dana b15bd4aa59 Add unsetopt/PRIVILEGED tests 2020-02-14 16:06:58 -06:00
Daniel Shahaf 8250c5c168 Improve PRIVILEGED fixes
- Fix retval handling in bin_setopt()

- Don't skip_setuid / skip_setgid.  It's not our place to optimize away noops
  (that might not even _be_ noops; they might change the saved uid…).

- Remove HAVE_* guard checks around functions that are used unguarded elsewhere.

- Use bsd-setres_id.c from OpenSSH to provide setresuid() / setresgid()
  everywhere, and thus simplify the ifdef soup.  Fix some preëxisting
  bugs in the macro definitions of setuid() (do we still need that one?).

- Fix zwarning() format codes for variadic arguments type safety

- Restored a comment from HEAD

- Fix failure modes around initgroups()

- Compared privilege restoration code with OpenSSH's permanently_drop_uid() and
  updated as needed

- Add E01 PRIVILEGED sanity checks
2020-02-14 16:06:57 -06:00
Martijn Dekker c578f0a08b 45004: Fix typos in comments 2019-12-11 02:37:39 +00:00
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.
2017-10-13 18:17:09 +01:00
Barton E. Schaefer b84d69cf52 41828, 41830: skip SHFILEEXPANSION for new nodes added by stringsubst() in prefork() 2017-10-08 18:08:09 -07:00
Peter Stephenson 97d4bdbc7e 41590 modified as 41595: make ERR_RETURN more logical.
It now operates separately at each function depth.

To keep ERR_EXIT global, make the noerrexit variable usd bit flags.

Extend tests.
2017-08-24 19:46:20 +01:00
Peter Stephenson a9b579a9d3 Revert "41499 (with one further tweak): POSIX_STRINGS behaviour."
This reverts commit 2eacbef919.

Conflicts:
	ChangeLog
2017-08-08 19:04:49 +01:00
Peter Stephenson 2eacbef919 41499 (with one further tweak): POSIX_STRINGS behaviour.
Ignore a terminating delimiter when splitting as separators
despite being called separators are terminators.
2017-08-07 18:47:43 +01:00
Peter Stephenson d4b94b5e83 41464, 41466: With POSIX_BUILTINS, exec only executes sexternal commands.
Document the default behaviour and add a test.
2017-07-27 09:22:04 +01:00
Peter Stephenson 408b92b168 41008: Handle expansions for precommand modifiers 2017-04-26 09:44:38 +01: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 c392e6c620 39915: whence: Honor PATH_DIRS option for arguments that start with './' or '../'.
While here, add some docstrings.
2016-11-17 15:28:42 +00:00
Barton E. Schaefer 95663e9365 37914: reparse associative array subscripts in "unset" so keys with "[" or "]" may be backslash-escaped
Also fix erroneous test case this revealed.
2016-02-08 20:52:11 -08:00
Peter Stephenson dc8c39efff 37303: test WARN_CREATE_GLOBAL negative cases. 2015-12-04 11:24:21 +00:00
Daniel Shahaf 51d50218fb unposted (after 37018): Fix typo in error message. 2015-10-30 15:03:12 +00:00
Peter Stephenson de9effbce6 37018: Make WARNCREATEGLOBAL more consistent.
Wd don't need separate math handling any more, and can make it
output the function name in all cases.
2015-10-29 17:06:27 +00:00
Daniel Shahaf 2654cb43f6 36651: WARN_CREATE_GLOBAL += math expressions
Without this, '() { (( x=42 )) }' and '() { for (( i=0; … )) }' wouldn't warn
about $x and $i, respectively, being created global.
2015-09-27 23:52:25 +00:00
Peter Stephenson ca9fdda408 36460: Discard benign error when no one is reading from pipe 2015-09-10 09:20:38 +01:00
Barton E. Schaefer e63065e8e5 35805: tests for 35799 2015-07-16 13:52:16 -07:00
Peter Stephenson 39b28980f3 various posts: Implement assignment parsing for typeset.
Typeset assignments now work like raw assignments except
for no "+=" and no GLOB_ASSIGN.

Documented in typeset builtin doc and mentioned in release notes.

Tests to ensure basic sanity.

Enabled by default, can be turned off by "disable -r" with typeset
family of commands.
2015-06-24 10:21:12 +01:00
Peter Stephenson 897ad46692 35369: better GLOB_ASSIGN testing 2015-06-02 16:23:08 +01:00
Peter Stephenson a2c579050f 34887: Fix POSIX_BUILTINS with assignment.
In the form
  var=val command special-builtin-or-func
the var is restored after execution, unlike the case where "command"
is absent.

Clear up case in code that handles this.

Add tests.
2015-04-15 09:44:19 +01:00
Peter Stephenson 8ebe18c081 34530: PRINT_EXIT_VALUE with anonymous functions.
Simpler fix, avoiding structural changes.
2015-02-16 12:37:38 +00:00
Barton E. Schaefer 7398fea059 34514: Back out 34485, an alternate solution needs to be worked out.
(Tweaked to keep the unrelated hunk of the E01 test.)
2015-02-12 09:27:53 -08:00
Peter Stephenson da86d6b4f2 34485: More rationalisation for anonymous functions.
Don't attempt to treat as "simple" case as there are too many
hidden problems.

Pull out some post-execution functions to a common case in
execcmd().
2015-02-09 16:39:29 +00:00
Peter Stephenson b5198b10a1 32768 with further modifications: LOCAL_LOOPS option. 2014-06-13 21:39:44 +01:00
Daniel Shahaf b28a6365f6 32091: WARN_CREATE_GLOBAL false positive.
In cases like () { foo=bar =true; }
2013-12-06 09:28:42 +00:00
Peter Stephenson 5236425865 users:18023: Add PIPEFAIL option 2013-10-06 21:35:27 +01:00
Peter Stephenson e3182c18de 29955++: IGNORE_CLOSE_BRACES option 2011-12-08 19:42:07 +00:00
Peter Stephenson ad29258c8c 29530: ${...?...} shouldn't cause an error with NO_EXEC option 2011-07-01 15:23:01 +00:00
Peter Stephenson dfc26195c9 28617: NO_EXEC option was doing too much work in
parameter subscripting, parameter assignment, and globbing
2011-01-10 18:24:17 +00:00
Peter Stephenson 3f3d80c394 28360: NO_UNSET option should check parameters with trailing options 2010-10-22 16:32:36 +00:00