1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-08 12:01:21 +02:00
Commit graph

166 commits

Author SHA1 Message Date
Peter Stephenson
0b3b259794 49433: Don't assume EPROG references are bounded by function depth.
We use references for efficient function copy, so there is no useful limit any more.
2021-10-05 16:45:55 +01:00
Marlon Richert
a675d058db 49378: skip check for collision of aliases and functions when NO_EXEC 2021-09-06 14:16:18 -07:00
Peter Stephenson
daa208e907 49269: Fix "[ ! -o ]".
This should detect "-o" as non-empty string; "-a" was alrady working.
Update the test.
2021-08-10 09:19:32 +01:00
Daniel Shahaf
d4da2c73f0 47300: Document the EC_NODUP, EC_DUP, EC_DUPTOK triplet.
All uses reviewed; no functional change.
2020-08-08 06:01:32 +00:00
Mikael Magnusson
8923d2a618 Add SHORT_REPEAT option 2020-04-02 07:42:16 +02:00
Daniel Shahaf
aed0cb4408 45583/0009: Add end-of-options guard support to 'function -T'. 2020-03-22 02:23:53 +00:00
Daniel Shahaf
386d9ac8ff 45583/0008: Add the 'function -T' syntax.
Config/version.mk was bumped in the previous commit.
2020-03-22 02:23:53 +00:00
Daniel Shahaf
a3c6c5513d 45583/0007: WC_FUNCDEF: Add a placeholder element. 2020-03-22 02:23:53 +00:00
Daniel Shahaf
fd1ef7d770 45583/0006: internal: Add some comments for orientation. No functional change. 2020-03-22 02:23:53 +00:00
Daniel Shahaf
e37df255c1 45583/0005: internal: Document the WC_FUNCDEF data layout for anonymous functions with arguments (follow-up to 29492) 2020-03-22 02:23:52 +00:00
Daniel Shahaf
338a4a299a 45583/0004: internal: Add some comments around wordcodes. No functional change. 2020-03-22 02:23:52 +00:00
Daniel Shahaf
4960699de2 45583/0003: internal: Add some comments around Eccstr. No functional change. 2020-03-22 02:23:52 +00:00
Daniel Shahaf
be73026b07 45583/0002: internal: Reduce some variables' visibility. No functional change. 2020-03-22 02:23:52 +00:00
Martijn Dekker
c578f0a08b 45004: Fix typos in comments 2019-12-11 02:37:39 +00:00
Peter Stephenson
4384fdc7f0 44446: Fix here document with file descriptor declarator.
Add unit test.
2019-06-24 20:19:19 +01:00
Peter Stephenson
30e356eb1a 44296: "typeset Q= {X}" crashed the shell. 2019-05-14 12:10:10 +01:00
Kamil Dudka
00e6ab70b8 44122: turn int into long to avoid overflow 2019-03-14 09:46:23 +00:00
Peter Stephenson
11f18457d2 Allow short loops with "while" 2018-04-23 13:45:08 +01:00
Martijn Dekker
54ea6a8cd5 42365: Use .zwc file if timestamp identical to source.
This can happen if the files are bundled together.
2018-03-05 09:31:11 +00:00
Peter Stephenson
97c74dcb0e 42110: Fix redirections between variable assignments at start of line 2017-12-12 09:13:41 +00:00
Peter Stephenson
e573857a03 41802 (minor tweaks): use heap during shell function call.
Replaces stack for more efficient memory management.

Also fix debug message when FUNCNEST is increased.
2017-10-04 09:18:51 +01:00
Peter Stephenson
5a8155f7b7 41633: Fix problem backgrounding function definitions.
Owing to being marked as simple sublists the instruction to
background was ignored.  This applied to anonymous functions.
2017-09-04 21:36:46 +01:00
Peter Stephenson
cfd34c75ac 41504: make empty strings work in case patterns with no leading parenthesis 2017-08-09 19:57:47 +01:00
Sebastian Gniazdowski
b31f947795 41402: Delay has_tokens() in ecstrcode as may not be needed 2017-07-09 17:38:01 +01:00
Sebastian Gniazdowski
e556f9c78d 41402: Add hasher to ecstrcode to reduce string comparisons 2017-07-09 17:34:55 +01:00
Peter Stephenson
af1c82d646 40173: Off-by-one error checking for {varid}.
This caused a single unprintable character in braces before a
redirection to be treated as an indentifier.
2017-05-08 18:00:55 +01:00
Peter Stephenson
641a764b82 users/22688: Allow mixing redirs and arguments after anon functions.
These are parsed differently from the case of normal functions which
can't take normal arguments at that point.
2017-05-08 17:19:22 +01:00
Peter Stephenson
f25d01a97c Fix combination of HERE document and |&.
A missing flag setting up the HERE document mean that the size
of the wordcode needed to append the 2>&1 was counted incorrectly,
so the resulting wordcode was garbled.

Add test.
2017-05-08 10:54:08 +01:00
Peter Stephenson
f3f8537cfa 40760: Always tokenize unquoted - to Dash.
This fixes use of pattern match character ranges in unusual contexts.

Attempt to detect a tokenized - in cases where we don't care.
2017-03-07 10:43:58 +00:00
Barton E. Schaefer
e51c9c17af 40453: signal handler safety for callers of patcompile(PAT_STATIC), which is not re-entrant. 2017-01-29 08:30:14 -08:00
Peter Stephenson
f26d1ba6b0 Add features associated with autoloading a function using an absolute
path.

-d defaults to normal fpath

-r remembers the path without actually loading.  May be combined with -d.

-R does the same but it's an error if not found

-X can now take a directory path: this is used to output not yet loaded
functions that have an associated path.
2017-01-11 11:26:13 +00:00
Peter Stephenson
bb218704d2 40306 with doc tweaks: Change behaviour expanding alias in () function definition.
Now an error unless the () is part of the same error as the name.
Add ALIAS_FUNC_DEF option to allow it again.
2017-01-10 19:14:26 +00:00
Peter Stephenson
88c42a2ba0 39777: $() is a valid empty command substitution 2016-10-30 17:12:04 +00:00
Oliver Kiddle
fbafc5b509 39332: support ksh's [[ -v varname ]] condition for checking if variables are set 2016-09-16 00:00:28 +02:00
Oliver Kiddle
00708285e9 unposted: remove duplicated assignment 2016-09-15 23:56:06 +02:00
Peter Stephenson
1993a3cd2a 39292: Distinguish "=" and "==" tests in output.
This is both in xtrace output and shell code rebuilt from
internal structures.
2016-09-13 09:42:24 +01:00
Peter Stephenson
28c46c1bfb 38111: Remove redundant return values in parsing.
Return values from par_list() and par_list1() are no longer used.
2016-03-07 10:49:35 +00:00
Barton E. Schaefer
bc958ab275 38106: if...then if...else should be a parse error. 2016-03-06 15:10:27 -08:00
Daniel Shahaf
bced1beb8c 37700: Teach ${(z)} the 'repeat WORD SUBLIST' syntax. 2016-01-29 09:14:53 +00:00
Barton E. Schaefer
62706b1abc 37469: do NOT allow semicolons in place of line breaks in conditionals 2015-12-31 14:16:56 -08:00
Barton E. Schaefer
0504dafa6e 37468: allow line breaks in more places in [[ ... ]] 2015-12-31 12:41:50 -08:00
Peter Stephenson
d45a68c546 36974: fix some functions with empty argument lists 2015-10-27 09:28:36 +00:00
Barton E. Schaefer
e61717b606 36566: check for regular file before lseek() 2015-09-19 23:05:44 -07:00
Peter Stephenson
881474edcb unposted: fix up for 5.0.8-test-2 2015-08-21 21:33:37 +01:00
Peter Stephenson
f4c37a78b1 36265 plus FAQ: fix alias expansion after "function"
Owing to interesting historical parsing, names after the first
were treated as command words so had non-global aliases expanded.
Add an FAQ note that use of the function keyword works around
other alias problems
2015-08-21 16:55:10 +01:00
Barton E. Schaefer
9958684574 36022 fix bug that some loop constructs could not be interrupted, revise signal queueing
There are two underlying ideas here:  (1) Keeping signals queued around
anything that's doing memory management (including push/pop of the heap)
has become crucial.  (2) Anytime the shell is going to run a command, be
it buitin or external, it must be both safe and necessary to process any
queued signals, so that the apparent order of signal arrival and command
execution is preserved.
2015-08-09 16:13:52 -07:00
Peter Stephenson
93e5234532 35643: Redirections after typeset assignments were broken. 2015-06-28 17:47:02 +01:00
Peter Stephenson
39b28980f3 various posts: Implement assignment parsing for typeset.
Typeset assignments now work like raw assignments except
for no "+=" and no GLOB_ASSIGN.

Documented in typeset builtin doc and mentioned in release notes.

Tests to ensure basic sanity.

Enabled by default, can be turned off by "disable -r" with typeset
family of commands.
2015-06-24 10:21:12 +01:00
Peter Stephenson
cb596a55d9 35306: "test -z \(" failed due to parse confusion 2015-05-27 21:25:55 +01:00
Peter Stephenson
a95f2c6071 35250: Fix case documentation (SH_GLOB) 2015-05-21 10:43:32 +01:00