about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'typesettounset' into declarednull declarednullBart Schaefer2021-04-138-3/+69
|\ | | | | | | Adds 'setopt typeset_to_unset', documentation, failure tests for POSIX incompatibilies, etc.
| * 48487 (amended): Failure test for math evaluation oddityBart Schaefer2021-04-131-1/+1
| | | | | | | | This was inadvertently included with TYPESET_TO_UNSET, so only the amendment is included here.
| * Update descriptive test for POSIX $((inf)) failureBart Schaefer2021-04-121-1/+2
| |
| * Completion system assumes typeset does initialize declared variables.Bart Schaefer2021-04-121-0/+1
| |
| * Change TYPESET_DOES_NOT_SET to TYPESET_TO_UNSET to avoid double-negativeBart Schaefer2021-04-127-5/+67
| |
| * Add TYPESET_DOES_NOT_SET option (cf. 48469)Bart Schaefer2021-04-104-2/+4
| |
| * unposted (cf. 48469): document oddness of ${emptystr[(i)]}.Bart Schaefer2021-04-101-0/+5
| |
| * Change DECLAREDNULL to DEFAULTEDBart Schaefer2021-04-103-12/+12
| |
| * Fix ${(t)var} output, add comparative test casesBart Schaefer2021-04-103-1/+31
| |
| * Missed files from POSXIBUILTINS commitBart Schaefer2021-04-102-8/+9
| |
| * Make DECLAREDNULL require POSIXBUILTINS and introduce a new test file.Bart Schaefer2021-04-101-0/+105
| | | | | | | | V10private has been made agnostic to POSIXBUILTINS.
| * Final repairs for declared state of tied arraysBart Schaefer2021-04-102-2/+7
| | | | | | | | Fixups still required in bin_typeset, but assignments to scalar work.
| * Additional tied-array cleanup when tied scalar had a previous valueBart Schaefer2021-04-101-3/+3
| |
| * Unset of a tied local scalar previously left it using tiedarr_gsuBart Schaefer2021-04-101-0/+2
| |
| * Partial fix for handling of tied arrays.Bart Schaefer2021-04-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | As of this commit when a tied array is declared but neither the scalar nor the array has an initializer, the array is initialized to empty. The scalar struct param of a tied pair stores a direct pointer to the internal array value of the array struct param, and upon assignment modifies it without referring to the containing struct. This means that there's no opportunity to clear the PM_DECLAREDNULL bits on both structs when the scalar is assigned. Conversely, assigning to the array does use the struct for the scalar.
| * Choose a better bit-value for PM_DECLAREDBart Schaefer2021-04-101-1/+1
| |
| * Add PM_DECLARED and PM_DECLAREDNULL parameter flags.Bart Schaefer2021-04-105-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses the issue that "typeset foo" creates $foo set to an empty string, which differs from typeset handling in bash and ksh. It does this by concealing the internal value rather than alter the way internal values are defaulted. This imposes the following changes: A typeset variable with no assignment triggers NO_UNSET warnings when the name is used in parameter expansion or math. The typeset -AEFHLRTZailux options are applied upon the first assignment to the variable. Explicit unset before the first assignment discards all of those properties. If any option is applied to an existing name, historic behavior is unchanged. Consequent to the foregoing, the (t) parameter expansion flag prints nothing until after the first assignment, and the (i) and (I) subscript flags also print nothing. The bash behavior of "unset foo; typeset -p foo" is NOT used. This is called out as an emulation distinction, not a change. The test cases have not been updated, so several now fail. The test harness has been updated to declare default values.
* | unposted (cf. 48469): document oddness of ${emptystr[(i)]}.Bart Schaefer2021-04-131-0/+5
| |
* | Change DECLAREDNULL to DEFAULTEDBart Schaefer2021-04-133-12/+12
| |
* | Fix ${(t)var} output, add comparative test casesBart Schaefer2021-04-133-1/+31
| |
* | Missed files from POSXIBUILTINS commitBart Schaefer2021-04-132-8/+9
| |
* | Make DECLAREDNULL require POSIXBUILTINS and introduce a new test file.Bart Schaefer2021-04-131-0/+105
| | | | | | | | V10private has been made agnostic to POSIXBUILTINS.
* | Final repairs for declared state of tied arraysBart Schaefer2021-04-132-2/+7
| | | | | | | | Fixups still required in bin_typeset, but assignments to scalar work.
* | Additional tied-array cleanup when tied scalar had a previous valueBart Schaefer2021-04-131-3/+3
| |
* | Unset of a tied local scalar previously left it using tiedarr_gsuBart Schaefer2021-04-131-0/+2
| |
* | Partial fix for handling of tied arrays.Bart Schaefer2021-04-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | As of this commit when a tied array is declared but neither the scalar nor the array has an initializer, the array is initialized to empty. The scalar struct param of a tied pair stores a direct pointer to the internal array value of the array struct param, and upon assignment modifies it without referring to the containing struct. This means that there's no opportunity to clear the PM_DECLAREDNULL bits on both structs when the scalar is assigned. Conversely, assigning to the array does use the struct for the scalar.
* | Choose a better bit-value for PM_DECLAREDBart Schaefer2021-04-131-1/+1
| |
* | Add PM_DECLARED and PM_DECLAREDNULL parameter flags.Bart Schaefer2021-04-135-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses the issue that "typeset foo" creates $foo set to an empty string, which differs from typeset handling in bash and ksh. It does this by concealing the internal value rather than alter the way internal values are defaulted. This imposes the following changes: A typeset variable with no assignment triggers NO_UNSET warnings when the name is used in parameter expansion or math. The typeset -AEFHLRTZailux options are applied upon the first assignment to the variable. Explicit unset before the first assignment discards all of those properties. If any option is applied to an existing name, historic behavior is unchanged. Consequent to the foregoing, the (t) parameter expansion flag prints nothing until after the first assignment, and the (i) and (I) subscript flags also print nothing. The bash behavior of "unset foo; typeset -p foo" is NOT used. This is called out as an emulation distinction, not a change. The test cases have not been updated, so several now fail. The test harness has been updated to declare default values.
* | 48522: README: Clarify _alternative changeDaniel Shahaf2021-04-132-1/+7
| |
* | 48525: vcs_info git docs: ahead/behind commits: Run fewer external programsTim Lee2021-04-132-6/+7
| |
* | 48439: remove macros that became unnecessary by df48cc8Jun-ichi Takimoto2021-04-122-26/+21
| |
* | 48504: use SEEK_ macros in fseek() callsOliver Kiddle2021-04-114-6/+12
| |
* | 45396: readhistfile: avoid thousands of lseek(2) syscalls via ftell()Michael Stapelberg2021-04-111-6/+10
| |
* | 48466: correct indentation and remove tabs and trailing spacesMarc Chantreux2021-04-112-29/+32
| |
* | 48445: pluralize tags in _surfrawMarc Chantreux2021-04-112-8/+11
| |
* | users/26645: update options in gv completionMarc Chantreux2021-04-112-1/+9
| |
* | 47794: exec: run final pipeline command in a subshell in sh modebrian m. carlson2021-04-104-4/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | zsh typically runs the final command in a pipeline in the main shell instead of a subshell. However, POSIX specifies that all commands in a pipeline run in a subshell, but permits zsh's behavior as an extension. The default /bin/sh implementations on various Linux distros and the BSDs always use a subshell for all components of a pipeline. Since zsh may be used as /bin/sh in some cases (such as macOS Catalina), it makes sense to have the common sh behavior when emulating sh, so do that by checking for being the final item of a multi-item pipeline and creating a subshell in that case. From the comment above execpline(), we know the following: last1 is a flag that this command is the last command in a shell that is about to exit, so we can exec instead of forking. It gets passed all the way down to execcmd() which actually makes the decision. A 0 is always passed if the command is not the last in the pipeline. […] If last1 is zero but the command is at the end of a pipeline, we pass 2 down to execcmd(). So there are three cases to consider in this code: • last1 is 0, which means we are not at the end of a pipeline, in which case we should not change behavior. • last1 is 1, which means we are effectively running in a subshell, because nothing that happens due to the exec is going to affect the actual shell, since it will have been replaced. So there is nothing to do here. • last1 is 2, which means our command is at the end of the pipeline, so in sh mode we should create a subshell by forking. input is nonzero if the input to this process is a pipe that we've opened. At the end of a multi-stage pipeline, it will necessarily be nonzero. Note that several of the tests may appear bizarre, since most developers do not place useless variable assignments directly at the end of a pipeline. However, as the function tests demonstrate, there are cases where assignments may occur when a shell function is used at the end of a command. The remaining assignment tests simply test additional cases, such as the use of local, that would otherwise be untested.
* | 47913: implement CASE_PATHS option to make NO_CASE_GLOB more sensibleBart Schaefer2021-04-105-1/+31
| |
* | unposted: README: Document incompatibility caused by workers/43928dana2021-04-102-0/+7
|/
* 48338: _git: Support case-insensitive path matchingdana2021-04-102-3/+13
|
* 48432 and enable test: fix quotiing of zstyle -L for zstyle -ePeter Stephenson2021-04-093-2/+9
|
* 48378: complete compadd options for other completion functionsOliver Kiddle2021-04-092-37/+87
|
* 48437: fix pid completion when cursor is in the middle of the lineOliver Kiddle2021-04-092-2/+5
|
* 47786: prepare for autoconf 2.70Felipe Contreras2021-04-093-56/+59
|
* 47785: remove deprecated autoconf functionsFelipe Contreras2021-04-095-40/+12
| | | | STDC_HEADERS and TIME_WITH_SYS_TIME are deprecated.
* 48416: update _gcore for macOS and GNUJun-ichi Takimoto2021-04-082-3/+18
|
* 48410: FAQ, METAFAQ: Mention zsh-security@.Daniel Shahaf2021-04-083-1/+15
|
* 48379: Make the parameter expansion subscript flags parse error message, ↵Daniel Shahaf2021-04-083-3/+34
| | | | "error in flags", identify the location of the parse error.
* 48321 (tweaked per thread): _perl_modules: Don't assume ${words[1]} to be ↵Daniel Shahaf2021-04-082-5/+11
| | | | | | | either "perl" or "perldoc" Also, correct an always-true condition guarding the fallback @INC codepath.
* 48425: Add an XFail test for a 'zstyle -L' escaping bug (workers/48424).Daniel Shahaf2021-04-072-0/+14
|