summary refs log tree commit diff
path: root/Src
Commit message (Collapse)AuthorAgeFilesLines
* 48857: declare "volatile" all globals that may be modified by signal handlersBart Schaefer2021-05-166-24/+26
|
* 33465: use prctl() for "jobs -Z" where availableHan Pingtian2021-05-151-0/+7
| | | | Bart apologizes for waiting 7 years to apply this change.
* 48723: locale-safe recognition of "Inf" and "NaN" constants in mathVincent Lefevre2021-05-151-2/+6
|
* users/26742: break out of surrounding shell loops when exit is called from ↵Peter Stephenson2021-05-151-1/+4
| | | | an exit hook
* users/26736: avoid infinite loop in getbyte from exit hookBart Schaefer2021-05-151-0/+4
|
* 48790: COMPLETE_IN_WORD inside brace-paramBart Schaefer2021-05-151-4/+24
|
* 48787: Fix command status after failed ifPeter Stephenson2021-05-061-1/+1
| | | | | | | If "if" had a hard error in the condition, and there was no else clause, the command status was incorrectly cleared to zero. Add test.
* 48614: getopts: Calculate OPTIND according to POSIX_BUILTINSdana2021-05-031-0/+10
|
* 47704: POSIX export and readonly ignore "-p" when parameter names also appearBart Schaefer2021-04-182-2/+10
|
* 48560: add TYPESET_TO_UNSET option to remove initialization of parametersBart Schaefer2021-04-185-7/+36
| | | | | | | | | | 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.
* 48439: remove macros that became unnecessary by df48cc8Jun-ichi Takimoto2021-04-121-26/+17
|
* 48504: use SEEK_ macros in fseek() callsOliver Kiddle2021-04-113-6/+6
|
* 45396: readhistfile: avoid thousands of lseek(2) syscalls via ftell()Michael Stapelberg2021-04-111-6/+10
|
* 47794: exec: run final pipeline command in a subshell in sh modebrian m. carlson2021-04-101-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-103-1/+10
|
* 48432 and enable test: fix quotiing of zstyle -L for zstyle -ePeter Stephenson2021-04-091-1/+2
|
* 47785: remove deprecated autoconf functionsFelipe Contreras2021-04-093-37/+6
| | | | STDC_HEADERS and TIME_WITH_SYS_TIME are deprecated.
* 48379: Make the parameter expansion subscript flags parse error message, ↵Daniel Shahaf2021-04-081-3/+25
| | | | "error in flags", identify the location of the parse error.
* 48391: fix display problem in menu-completeJun-ichi Takimoto2021-04-061-1/+1
| | | | | Take account of the trailing file type character even when '-d disp' is given to compadd.
* 48389: getkeystring() should not return ptr to local varJun-ichi Takimoto2021-04-062-9/+31
| | | | | Now it returns NULL if called with GETKEY_SINGLE_CHAR and next character is not found. Caller must check the return value.
* 47784: silence a compiler waring from pattern.cFelipe Contreras2021-04-041-1/+1
|
* 47510: drop code that avoided termcap for named coloursOliver Kiddle2021-04-032-44/+13
| | | | | | The inconsistency caused test failures where TERM is e.g. rxvt-unicode. This also makes a couple of bits available in zattr by removing flags indicating whether to use termcap which is not an attribute as such.
* 48202 + 48366: Fix handling of NUL bytes in zexpandtabs multibyte versionMikael Magnusson2021-04-011-1/+4
|
* 47745: Fix [:IDENT:] vs posixidentifiersStephane Chazelas2021-03-231-1/+1
| | | | | wcsitype(c, IIDENT) should return false for non-ASCII characters when the POSIX_IDENTIFIERS option is on, not the other way round.
* users/26509: fix for r -LPeter Stephenson2021-02-181-2/+3
| | | | | fc with the -L option should ignore remote entires, rather than reading them and treating them as an error.
* 48073: Add fc -s as POSIX way of rerunning command without starting editorMartijn Dekker2021-02-171-2/+2
|
* Allow more scripts without #!Justine Tunney2021-02-161-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change modifies the zsh binary safety check surrounding execve() so it can run shell scripts having concatenated binary content. We're using the same safety check as FreeBSD /bin/sh [1]. POSIX was recently revised to require this behavior: "The input file may be of any type, but the initial portion of the file intended to be parsed according to the shell grammar (XREF to XSH 2.10.2 Shell Grammar Rules) shall consist of characters and shall not contain the NUL character. The shell shall not enforce any line length limits." "Earlier versions of this standard required that input files to the shell be text files except that line lengths were unlimited. However, that was overly restrictive in relation to the fact that shells can parse a script without a trailing newline, and in relation to a common practice of concatenating a shell script ending with an 'exit' or 'exec $command' with a binary data payload to form a single-file self-extracting archive." [2] [3] One example use case of such scripts, is the Cosmopolitan C Library [4] which configuse the GNU Linker to output a polyglot shell+binary format that runs on Linux / Mac / Windows / FreeBSD / OpenBSD. [1] https://github.com/freebsd/freebsd-src/commit/9a1cd363318b7e9e70ef6af27d1675b371c16b1a [2] http://austingroupbugs.net/view.php?id=1250 [3] http://austingroupbugs.net/view.php?id=1226#c4394 [4] https://justine.lol/cosmopolitan/index.html
* 47905: Add leading '-' to zparseopts option parsing errorsJoshua Krusell2021-02-131-4/+4
|
* 47997: Disable XTRACE around user-defined completion widgets.Bart Schaefer2021-02-111-0/+3
|
* 47895: Remove trailing spaces from "print -ac" output lines.Bart Schaefer2021-02-041-1/+1
|
* 47899: Improve error message from zparseopts.Joshua Krusell2021-02-031-1/+4
|
* 47744: Fix vi repeats with hooks in use.GammaFunction2021-01-271-0/+2
|
* 47840: make zpty module work on CygwinPeiyuan Song2021-01-201-0/+11
|
* 47704: fix scope for "private -p"Bart Schaefer2020-12-021-0/+4
|
* 47494, 47495: Add -n option to strftimeMikael Magnusson2020-10-251-2/+3
|
* 47301: Fix print -v metaficationJun-ichi Takimoto2020-10-251-1/+1
|
* Fix a race condition in zf_mkdir -pRoman Perepelitsa2020-10-231-9/+19
| | | | | | If ~/foo does not exist and `zf_mkdir -p zf_mkdir -p` is executed concurrently in multiple shells, it was possible prior to this patch for the command to fail with EEXIST.
* Unposted - fix commentBart Schaefer2020-09-131-1/+1
|
* 47364: Enable extendedglob in pattern with ${(*)name/pattern/replacement}Bart Schaefer2020-09-132-4/+16
| | | | Mikael Magnusson: 47382: Completion for 47364
* 47352 (+ extra test cases): fix %<n>K prompt expansionStephane Chazelas2020-09-101-1/+1
| | | | | | | | | | | Fixed a regression introduced by workers/30496 (5.0.3) whereby %2K would no longer be the equivalent of %K{2} (%K{green}) in prompt expansion. That was one missing case where the is_fg flag was not passed along to match_colour() after code factorisation. Add tests for the different syntax variants, using echoti as a reference.
* github #64: Fix a build-time error when building against ncurses that hadn't ↵Daniel Shahaf2020-08-281-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | been built with --enable-wgetch-events. The --enable-wgetch-events codepath is experimental (according to ncurses-6.2/INSTALL) and off by default (according to ncurses-6.2/configure.in). With that codepath disabled, the macro KEY_EVENT is not provided, which (before this commit) manifested as a build-time error: [ 245s] gcc -c -I. -I../../Src -I../../Src -I../../Src/Zle -I. -DHAVE_CONFIG_H -DMODULE -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/ncursesw -fPIC -o curses..o curses.c [ 246s] In file included from curses.c:210: [ 246s] curses_keys.h:93:15: error: 'KEY_EVENT' undeclared here (not in a function); did you mean 'KEY_RESET'? [ 246s] 93 | {"EVENT", KEY_EVENT}, [ 246s] | ^~~~~~~~~ [ 246s] | KEY_RESET curses_keys.h is only used for setting the "kevent" output parameter of 'zcurses input' (and the associated $zcurses_keycodes special variable), so there's no harm in just leaving KEY_EVENT out of it. (That codepath deals gracefully with numeric values that don't correspond to any of the known compile-time values, as that can happen whenever the build- and run-time versions of ncurses don't provide the same set of KEY_* macros, with or without relation to that configure flag.) Reported by Martin Liska.
* 47296 (+ unposted additional tests and comments): 'repeat' loops: Let the ↵Daniel Shahaf2020-08-081-1/+1
| | | | | | repeat count use $?. It's an arithmetic expression.
* 47300: Document the EC_NODUP, EC_DUP, EC_DUPTOK triplet.Daniel Shahaf2020-08-082-3/+27
| | | | All uses reviewed; no functional change.
* unposted: comments explaining how hashtable must be createdRoman Perepelitsa2020-07-291-1/+4
| | | | See zsh-workers 46277, 46278, 46279.
* 46275: eliminate undefined behavior caused by redefinition of hashtableRoman Perepelitsa2020-07-292-55/+56
| | | | | struct hashtable has different set of data members in different translation units. This is undefined behavior.
* 46268: suppress a useless compiler warning around nice()Roman Perepelitsa2020-07-281-2/+1
| | | | | | | From nice(2): To detect an error, set errno to 0 before the call, and check whether it is nonzero after nice() returns -1.
* 46152: zsh/system: Re-allow '0' timeout in zsystem flockCedric Ware2020-07-111-3/+3
|
* 46175/0003: Fix the RM_STAR_SILENT bug from the parent commit.Daniel Shahaf2020-07-051-1/+1
|
* 46168: Update $PWD and call chpwd hook after normalizing pathMatthew Martin2020-07-031-18/+17
|
* users/24971: ${(-)var} sorts on signed integersPeter Stephenson2020-07-033-9/+27
|