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
d27ea2ae02
unposted (cf. 52617): only scalars can instantiate a declared named reference
2024-03-04 21:36:45 -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
Bart Schaefer
d1ff06f991
52652: fix obscure bug unsetting the array part of a tied parameter pair
2024-03-02 21:37:25 -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
Oliver Kiddle
5331ff11c6
52594: support for POSIX real-time signals with kill and trap
...
Also add new -L option to kill for a more verbose listing of signals
2024-02-28 00:21:11 +01: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
336249e7ea
unposted: referent of named reference cannot start with digits
...
This duplicates ksh behavior and doesn't change useful functionality.
2024-02-18 12:19:25 -08: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
Bart Schaefer
98a6892cb1
52244: Fix a batch of minor defects reported by Coverity.
...
Coverity defects 1547831, 1547826 (remove unused function), 1521551,
1500752, 1500747, 1401549, 1372423, 1270645, 1255799, 1255792, 1255789,
1255787, 1255782, 1255750
2023-10-26 08:27:18 -07:00
Bart Schaefer
0f0ba0539e
52195: cached_username is already metafied when initializing LOGNAME
2023-10-01 13:38:25 -07:00
Bart Schaefer
29644f12e7
52193: handle UTF8-encoded USERNAME and therefore home directory in zcompile
...
Includes one unposted thinko fix ztrdup -> dupstring
2023-10-01 11:34:33 -07: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
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
Bart Schaefer
8d009d35a9
51510: Skip namespaces in "set"/"typeset" output, add tests, fix bug
2023-03-06 20:01:04 -08:00
Bart Schaefer
0562be0af8
51509 (+ fix typo): Add ${(!)name} for the referred-to name of a named reference
...
Extend ${!name} in ksh emulation for same
2023-03-06 19:54:48 -08:00
Bart Schaefer
4bc1f6e0d2
51484: Extend named reference handling for special parameters, improve doc.
2023-03-05 14:06:25 -08:00
Bart Schaefer
a9ba166216
51483: Enable assignment and expansion of parameters with ksh-like namespace prefixes.
2023-03-05 14:03:42 -08:00
Peter Stephenson
82f307bddf
Fix access to autoloaded parameter.
...
Namerefef resolution needs to happen on the parameter after autoload.
2023-02-21 12:16:40 +00: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
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
3eed6f70cd
51402: Some ksh/bash features, additional sanity checking
...
* Add "unset -n"
* Allow and enforce "typeset -n -r" for read-only references
* "can't change type via subscript reference" error
* Better checking for self-referential declarations/assignments
* Ksh-style "foo=bar; typeset -n foo" creates foo=bar reference
* Support "typeset -n ref; for ref in ..."
* Subscripted references use NO_EXEC for safety
* References assigned in called scopes reset scope at end
* Allow named references to $! $? $$ $- $0 $_
2023-02-12 11:51:41 -08:00
Bart Schaefer
3e55a135c1
51374: Expose named references in $parameters, fix substitution error.
2023-02-12 11:29:10 -08:00
Bart Schaefer
511e020c68
51360: Initial implementation of named references.
2023-02-12 11:21:23 -08:00
Peter Stephenson
03292bceec
51278: make (i) subscript flag for zero-length string consistent
2023-01-16 11:10:02 +00:00
Oliver Kiddle
a73c705b0c
51212: remove STOUC() macro
...
This served as a workaround for ancient compilers where casts to
unsigned char were broken.
2022-12-16 23:28:10 +01:00
Jun-ichi Takimoto
1be52186b4
51079: metafy sep in array subscript flag (s:sep:)
...
this enable sep to contain \0 etc.
2022-12-02 19:32:11 +09:00
Jun-ichi Takimoto
09ad15b986
50081: reset global mbstate_t variables when LC_CTYPE changes
2022-04-20 21:06:53 +09:00
Oliver Kiddle
926a1a7296
49602: only set LOGCHECK from the watch module
2021-11-28 20:51:41 +01:00
Oliver Kiddle
271cfc685b
49534, 49539: separate watch/log functionality out into a module
2021-11-02 21:41:53 +01:00
Bart Schaefer
fa4c88ca25
49456: clean up detection of private params in nested scopes, update doc
2021-10-04 09:02:27 -07:00
Jun-ichi Takimoto
dd51ffa5b4
49422: improve support of --disable-dynamic-nss
...
see also 49392 (Vincent) and 49412 (Axel)
2021-09-22 13:36:57 +09:00
Bart Schaefer
cf5c4828d1
48857: declare "volatile" all globals that may be modified by signal handlers
2021-05-16 19:51:11 -07:00
Bart Schaefer
71b747567e
47704: POSIX export and readonly ignore "-p" when parameter names also appear
2021-04-18 14:26:12 -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
Peter Stephenson
c486040220
45772: Restore locale on parameter scope end.
...
Check if relevant parameters changes and if so restore system settings.
2020-05-05 20:28:31 +01:00
Daniel Shahaf
5e843a3721
45340: internal: Document the difference between paramtab and realparamtab.
2020-01-23 03:21:36 +00:00
Daniel Shahaf
ae7e291873
45066: internal: Document forklevel, locallevel, and exit_pending.
2019-12-18 06:01:50 +00:00
Martijn Dekker
c578f0a08b
45004: Fix typos in comments
2019-12-11 02:37:39 +00:00
Peter Stephenson
d946f22a4c
44664: Fix problem with temporary assignment.
...
"foo=bar builtin" inside a function lost any variable from
enclosing scope.
2019-08-14 15:16:59 +01:00
Peter Stephenson
8cbbc04d97
44509: Prevent crash with modified path / PATH combination.
...
Crash came from "fn() { typeset -U path=($path); unset PATH; }".
Note PATH unset is global as only path was made local.
2019-07-15 09:44:47 +01:00
Oliver Kiddle
3de2333b08
44307: allow for atoi() returning a negative number
2019-05-20 00:14:01 +02:00
Wesley Schwengle
51d2e91a7e
44164: Avoid stringop-truncation warning
2019-03-25 20:42:54 +09:00
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.
2018-10-08 10:10:42 +01:00
Stephane Chazelas
a75b47973d
43546: "typeset -p" should show -U flag
2018-09-25 10:06:18 +01:00
Peter Stephenson
f58b35bf88
43264: fix ${+assoc[nonexistent]} with KSH_ARRAYS
2018-08-09 09:48:35 +01:00