1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-06-16 08:48:06 +02:00
Commit graph

469 commits

Author SHA1 Message Date
Bart Schaefer
8701313c61 53363: permit "typeset -n +m pattern"
Also fix spurious error printing the value of a read-only named reference
2025-02-15 14:29:51 -08:00
Bart Schaefer
7a54b36fa8 53348: Revise handling of incompatible typeset options when used with -n 2025-02-12 20:03:07 -08:00
Oliver Kiddle
f7b5cc431b 53332, 53334: Avoid strlen calls after sprintf 2025-01-30 12:30:40 +01:00
Jun-ichi Takimoto
a3b56d4f03 52951: make sure to close memstream for 'print -v' 2024-06-13 11:18:13 +09:00
Bart Schaefer
7c875adb09 52742: fix bad interactions of "typeset -p" with GLOBAL_EXPORT 2024-03-12 18:00:19 -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
c0a392b392 unposted (cf. 52615): use META_NOALLOC for 52591 2024-03-04 21:39:29 -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
610b18875a 52650 plus minor fixes: add -u for named references pointing to "upper" scope 2024-03-04 21:07:01 -08:00
Bart Schaefer
13f73d84d3 52645: unset through a nameref keep up-scope parameters declared unset
Othewise unset of a reference to a global wipes out all parameters of
the same name.
2024-03-01 15:43:50 -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
Stephane Chazelas
4c0ebc155e 52591: printf builtin must pass metafied strings to math evaluation 2024-02-24 20:41:33 -08:00
Bart Schaefer
8c59638522 52556: fix crash when changing type of unset referent via named reference 2024-02-17 20:27:56 -08:00
Bart Schaefer
3406089647 52468: save and restore state of correct TTY when using read -s / -d 2024-01-24 17:27:41 -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
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
Bart Schaefer
aa85564319 51969: read -d and -s should not reset terminal state when stdin is redirected 2023-07-26 19:54:30 -07:00
Bart Schaefer
5ead24c881 51890: fix "whence -wa" for multiple arguments 2023-07-09 19:28:28 -07:00
Peter Stephenson
6763f45e77 58586: print "%s" with invalid multibyte character
Treat each byte that is invalid or part of an incopmlete set as a single byte.
2023-03-22 10:24:11 +00:00
Bart Schaefer
4b7a9fd0ec 51573: additional "typset -p -m" fix for namespaces
The "-m pattern" option is supposed to enable printing namespaces, but
that didn't work when combined with -p.

The -p option could also cause an unset parameter to become set if a
named reference pointed at it.
2023-03-14 20:51:15 -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
d2768f2f88 51431: "typeset -p" shouldn't change parameter flags 2023-02-20 10:32:40 -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
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
511e020c68 51360: Initial implementation of named references. 2023-02-12 11:21:23 -08:00
Oliver Kiddle
667ead3a64 51258, 51272: refactor handling of terminal attributes, removing OFF flags in zattr 2023-01-10 20:53:17 +01:00
Oliver Kiddle
35a2f155c3 51214: handle read -d and a delimiter that can't be decoded into a character
Terminate input at the raw byte value of the delimiter.
Also document and test the use of an empty string as a way to specify
NUL as the delimiter.
2022-12-17 00:37:19 +01:00
Jun-ichi Takimoto
2701ab161d 51207: fix for read -d when the delimiter is a byte >= 0x80 2022-12-17 00:35:36 +01: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
Matthew Martin
d4955bc0f9 50359: fix bad sticky-emulation in "functions -c" 2022-06-09 13:37:51 -07:00
Bart Schaefer
d24ab95469 50351: "functions -c" can set signal traps 2022-06-09 13:30:55 -07:00
Bart Schaefer
e127ceaae8 50149: Remove all remaining =(...) files at shell exit 2022-04-30 11:21:03 -07:00
Bart Schaefer
d24d7242fe 50068: 'exit' in trap causes calling function to return 2022-04-14 16:31:50 -07:00
Oliver Kiddle
271cfc685b 49534, 49539: separate watch/log functionality out into a module 2021-11-02 21:41:53 +01:00
Jun-ichi Takimoto
2b81d4be32 unposted: add/remove UNUSED() for some function parameters 2021-09-08 11:58:29 +09:00
Bart Schaefer
5b4a1626c2 49069: literal interpretation of subscripts for unset of array/hash elements 2021-06-13 16:30:06 -07:00
Bart Schaefer
cf5c4828d1 48857: declare "volatile" all globals that may be modified by signal handlers 2021-05-16 19:51:11 -07:00
Peter Stephenson
db36149006 users/26742: break out of surrounding shell loops when exit is called from an exit hook 2021-05-15 13:59:17 -07:00
dana
c23a0d84b0 48614: getopts: Calculate OPTIND according to POSIX_BUILTINS 2021-05-03 18:11:38 -05: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
6bef719302 users/26509: fix for r -L
fc with the -L option should ignore remote entires, rather than
reading them and treating them as an error.
2021-02-18 21:37:08 +00:00
Martijn Dekker
9c0533931c 48073: Add fc -s as POSIX way of rerunning command without starting editor 2021-02-17 10:21:08 +00:00
Bart Schaefer
465738fc25 47895: Remove trailing spaces from "print -ac" output lines. 2021-02-04 17:52:22 -08:00
Jun-ichi Takimoto
b6ba74cd4e 47301: Fix print -v metafication 2020-10-25 23:05:19 +01:00
Matthew Martin
4e471c3f89 46168: Update $PWD and call chpwd hook after normalizing path 2020-07-03 21:17:58 -05:00
Mikael Magnusson
ed23768f77 typeset: Fix leaving corrupted entries in paramtab 2020-06-05 15:42:31 +02:00
Daniel Shahaf
4d2bcf2fe7 45729: internal: Add a second parameter to zlinklist2array(), analogously to hlinklist2array().
Will be used in the next commit.
2020-05-03 01:27:36 +00:00
Peter Stephenson
66ee4918a1 45660: Fix crash setting vi or emacs mode on command line.
Delay setting the option until the module system is set up.
2020-04-09 21:46:20 +01:00
Peter Stephenson
a6a1b28b98 45487: Missing mod_export declarations for AIX 2020-02-24 10:55:48 +00:00