Commit Graph

4136 Commits

Author SHA1 Message Date
Jun-ichi Takimoto ac6257f150 50418: use setenv(3)/getenv(3) on newer macOS 2022-07-24 20:41:20 +09:00
Bart Schaefer cb59dfb3a6 50379/50380: fix off-by-one side-effect of workers/49906 that broke $(jobs -l) 2022-06-21 18:04:45 -07:00
Bart Schaefer f7441b4645 50368: adjust ztie'd bitflags so local variables cannot mess with database 2022-06-21 17:58:57 -07:00
Bart Schaefer 61f35bb626 50355: documentation and return status consistency in zsh/system module 2022-06-11 15:02:46 -07:00
Bart Schaefer 285b6c2538 50363: avoid use of heap memory that depends on parameter scoping 2022-06-09 15:10:43 -07: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
Jun-ichi Takimoto c36068357b 50342: fix test added by 50306 2022-06-09 15:08:39 +09:00
Bart Schaefer 734740a5ed 50341: disallow here-document markers containing newline 2022-06-08 20:48:42 -07:00
Peter Stephenson b26b6b3fe0 Tweaks to MULTI_FUNC_DEF
Output multiple function definitions using "function" form.

Note exceptions to errors with NO_MULTI_FUNC_DEF
2022-06-07 10:02:14 +01:00
Bart Schaefer 3e3cfabcc7 50325: revert 38150 and fix in calling function cfp_matcher_range() instead 2022-06-03 20:08:15 -07:00
Jun-ichi Takimoto 22b1a91c2a 50306: fix wait for child that was stopped/continued
do not call addbgstatus() when child is stopped/continued
2022-06-03 19:32:56 +09:00
Jun-ichi Takimoto c190883a0a 50192: use set{u,g}id() for dropping privilege on NetBSD 2022-05-11 11:22:46 +09:00
Bart Schaefer 276020522e 50150: Filenames need unmetafy for printing 2022-04-30 11:24:21 -07:00
Bart Schaefer e127ceaae8 50149: Remove all remaining =(...) files at shell exit 2022-04-30 11:21:03 -07:00
Bart Schaefer 8181708feb 50136: Fix =(nosuchcommand) race/deadlock first reported in workers/42609 2022-04-29 20:37:09 -07:00
Bart Schaefer 15bf8ace16 50134: Tweak process group handling to prevent unkillable pipelines
In some cases the process group leader of the forked-left side of a
pipe needs to be set to the pipe process PID rather than to the group
leader PID returned by entersubsh().
2022-04-29 20:25:53 -07:00
Bart Schaefer df0c783f4b 50133: use read-ahead and lseek-rewind for efficient line-buffered input 2022-04-28 21:06:51 -07:00
Bart Schaefer 007c7df74a 50101: sysread -o with param adjusted to match documentation 2022-04-28 17:08:10 -07:00
Bart Schaefer 0ccc3c1494 50162: Fix multios with current-shell "exec" (aka nullexec). 2022-04-28 17:03:31 -07:00
Peter Stephenson c5a891a29d 50049: care with signed characters
Some signed-to-unsigned casts needed for a couple of cases of pointers
used as indices.
2022-04-25 17:51:59 +01:00
Jun-ichi Takimoto 09ad15b986 50081: reset global mbstate_t variables when LC_CTYPE changes 2022-04-20 21:06:53 +09:00
Jun-ichi Takimoto baa12a413f 50080: add missing STOUC() in casemodify() 2022-04-20 21:01:08 +09:00
Bart Schaefer d24d7242fe 50068: 'exit' in trap causes calling function to return 2022-04-14 16:31:50 -07:00
Mikael Magnusson 1039b09c0c 50042: Another fix for 49915
If the last element in the list is a duplicate, we would walk off the end
2022-04-11 23:31:11 +02:00
Bart Schaefer ebad5f8164 49994: Single-byte equivalence of users/22601 and workers/40891 2022-04-05 09:10:45 -07:00
Peter Stephenson 02747bbbd3 49989: Single byte versions of nice quoting.
Align interfaces for "nice" printing of characters with those for
multibyte to make more available in single-byte compilation.
2022-04-05 09:40:07 +01:00
Bart Schaefer 0d9c2422bf 49992: further unify single- and multi-byte implementations of nicechar() 2022-04-04 14:48:21 -07:00
Bart Schaefer b80d160039 49991: single-byte brace expansion handles $'\0' and control character output aligns with multibyte 2022-04-04 14:21:50 -07:00
Bart Schaefer bdd37b4c14 49990: casemodify() avoids metafying characters that it otherwise did not touch 2022-04-04 13:20:45 -07:00
Bart Schaefer f27e48827c unposted: Fix typo from 49955 2022-04-04 10:19:57 -07:00
Bart Schaefer c77cdb27db 49955: Src/glob.c: fix bad free in incremental-pattern-search matching 2022-04-04 09:14:59 -07:00
Mikael Magnusson 9eda397354 49957: Brown paper bag for 49915
The code would crash when n == 0. There's not really any point doing any
of this when n is 0 so just skip everything. It also tried to NULL
terminate a list a little to eagerly.
2022-04-03 11:28:14 +02:00
Matthew Martin 95749e9e65 49933: Add nonblock to sysopen 2022-03-31 17:40:41 -05:00
Mikael Magnusson 774c634d2e 49926: remove unused variable from 49915 2022-03-30 20:34:37 +02:00
Peter Stephenson 98e4634086 49906 (Bart), 49911: Fixes to querying jobs in subshell.
Don't attempt to query invalid job off end of table, resulting in
crashes from $jobtstates.

If background task started in subshell, look at tatsks within subshell
instead of main shell.  Document and add test.
2022-03-30 09:28:43 +01:00
Mikael Magnusson 054ccf7666 49820: Fix a crash when completing with combination of -Q and braces
minimal reproducer .zshrc:

  zstyle ':completion:*' completer _oldlist _complete
  setopt nolistambiguous
  autoload compinit; compinit
  compdef _foo foo;_foo() { compadd -Q -- stash@{{0,1}} }
2022-03-30 08:08:09 +02:00
Mikael Magnusson d7b8619396 49813: <<<: Document newline behavior and fix optimization
The =(<<<foo) optimization forgot to add a newline, but =(cat<<<foo)
always did, make the behavior consistent, and document it.
2022-03-30 08:07:39 +02:00
Mikael Magnusson 3bf95b91f0 49870: Fix NULL reference in match code more
This reverts "49658: Fix NULL reference in match code." and adds a check
inside the block, as well as a failsafe check at the end.

The above commit (49658) causes a crash due to ll being calculated as
0 which leads to rr being an invalid pointer. Only adding a check for
when ll is 0 just leads to bck-i-search pattern not working at all (the
final hunk).  Restoring the condition and adding an explicit NULL check
for replstr seems to make matters work as intended.
2022-03-30 08:07:39 +02:00
Mikael Magnusson 6a9b3bb290 49915: Efficient dedup for unsorted completions 2022-03-30 08:07:39 +02:00
Mikael Magnusson 48be30e530 49893: Fix comments for UNIQCON/ALL 2022-03-30 08:07:39 +02:00
Jun-ichi Takimoto 8154ddc62d 49853 + 49882/49883: make "${arr[*]:off}" compatible with ksh/bash 2022-03-29 11:09:36 +09:00
Peter Stephenson 1e814ba48b 49890: Avoid scanning unallocated memory in saved command line. 2022-03-28 15:27:51 +01:00
Peter Stephenson 1640457f47 49792: Non-interative shell input is line buffered. 2022-03-03 19:19:35 +00:00
Peter Stephenson 6a8aa2aa5a 49783: Consistently use old job table in parameter module 2022-03-01 17:27:42 +00:00
Daniel Shahaf 45182eb4d4 unposted: Fix some typos and markup. 2022-02-22 13:11:02 +00:00
Oliver Kiddle c3ea1e5d52 security/41: Don't perform PROMPT_SUBST evaluation on %F/%K arguments
Mitigates CVE-2021-45444

(cherry picked from commit c187154f47)
2022-02-12 10:29:55 -06:00
Mikael Magnusson 8bf0f0cf45 49694 + doc: Allow using empty STTY= to freeze tty for a single command
Previously, doing this would just run stty with no arguments, which
normally causes it to print some terminal settings to stdout.
2022-01-30 18:14:54 +01:00
m0viefreak d82604843b 38150: fix off-by-one error in matcher spec parsing 2021-12-24 13:09:25 -08:00
Peter Stephenson 7f240e6aa9 49658: Fix NULL reference in match code.
A test when acquiring the replacement pattern match in the globbing
code erroneously allowed the use of a NULL pointer.  This appears to
be an unnecessary test case added alongside other surgery back in 2008.
2021-12-21 10:31:26 +00:00