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

132 commits

Author SHA1 Message Date
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
Peter Stephenson
afb78f5d14 35248: treat fully parenthised zsh patterns as complete case patterns again 2015-05-21 10:25:07 +01:00
Peter Stephenson
2d6569e590 35184: Additional case fix for 35168.
Lexical analysis flags got screwed up after a "|", so we
didn't parse patterns properly, in particular those with parentheses.
2015-05-18 12:06:43 +01:00
Peter Stephenson
52aeb9aaeb 35168: Improve parsing of case patterns.
"|" is now found properly by looking for words that come
from the lexical analyser, rather than hacking a pattern
returned in one dollop.

Update some completion functions that need extra quoting
as a result.

Add test for new parsing.

Update version number to 5.0.8-dev-3 because of wordcode
incompatibility.
2015-05-18 09:56:00 +01:00
Peter Stephenson
2e48eceb1a 34921: handle error in recursive par_event().
Here documents in an interrupted list caused bad juju.
2015-04-17 22:43:38 +01:00
Peter Stephenson
4508d25710 34905: no parse error after keyboard interrupt.
Handled generally, though only showing up in special nested
cases.

Also fix ZLE so it doesn't cancel the interrupt flag when
not actually returning from a local keymap.
2015-04-17 10:23:58 +01:00
Barton E. Schaefer
7398fea059 34514: Back out 34485, an alternate solution needs to be worked out.
(Tweaked to keep the unrelated hunk of the E01 test.)
2015-02-12 09:27:53 -08:00
Peter Stephenson
da86d6b4f2 34485: More rationalisation for anonymous functions.
Don't attempt to treat as "simple" case as there are too many
hidden problems.

Pull out some post-execution functions to a common case in
execcmd().
2015-02-09 16:39:29 +00:00
Peter Stephenson
cfd91eac07 Rearrange context saving.
Variables are now associated with the module that declares them, being
initialised and saved/restored there.  However, as many variables are
used for communication between modules, many of them are set in multiple
places, so the assignment is ambiguous.
2015-01-09 21:33:39 +00:00
Peter Stephenson
c0d01a6fe0 Fix command substitutions to parse contents as they are read in.
Do this by refactoring misnamed lexsave()/lexrestore() to allow
continuity of history and input.

Add test.
2015-01-08 12:24:00 +00:00
Peter Stephenson
d067ebcacd 33876: etc.: Separate errors and keyboards interrupts
Combination of 12 commits from interrupt_abort branch.

Basic strategy is to introduce bits to errflag and to set and
reset them separately.

Remove interrupt status on return to main keymap.

Turn off ERRFLAG_INT for always block.

Restore bit thereafter: we probably need a new variable in order
to allow user interrupts to be reset in the always block.

Add TRY_BLOCK_INTERRUPT

This works the same as TRY_BLOCK_ERROR, but for a SIGINT, too.

Ensure propagation of SIGINT from exited job.

If received by foreground job, shell uses ERRFLAG_INT, not
ERRFLAG_ERROR, to set the new state.

Reset errflag before precmd()

Add always block in _main_completion to fix ZLS_COLORS

Ensures we get the right state of $ZLS_COLORS at the end of _main_complete
even if there's an interrupt.  However, the "right state" is a bit messy
as it depends on styles.
2014-12-11 09:41:17 +00:00
Wayne Davison
389954beec unposted: fix compiler set-but-not-used warning. 2014-11-28 11:55:17 -08:00
Bart Schaefer
74e26bf126 33346: another bit of the 33345 repair 2014-10-03 08:50:25 -07:00
Peter Stephenson
31750795fe 33345: fix anonymous function complex command handling.
Longstanding problem caused simple anonymous function incorrectly to
reset the overall "complext" state, causing wordcode to be diverted
into execsimple(), which caused a crash 'cos ist wasn't simple.
2014-10-03 16:29:56 +01:00
Peter Stephenson
a778215b7c unposted: comments in previous commit were reversed 2014-10-03 14:20:24 +01:00
Peter Stephenson
7666ceb2bc 33343: Variant anonymous function synax with arguments.
Don't expand arguments as if in command position. Test.
2014-10-03 14:17:33 +01:00
Peter Stephenson
cf6b0f5663 33285: apply function definition redirections at execution 2014-09-29 21:02:59 +01:00
Peter Stephenson
d19d9c1eff 33242: tokens following if, for, repeat, while aren't in command position 2014-09-26 14:07:43 +01:00
Barton E. Schaefer
9d47e8398d 32609: [[ $var ]] behaves as [[ -n $var ]] for bash/ksh compatibility
Also restore ksh [ -t ] compatibility when POSIX_BUILTINS is not set, and
allow operators defined by modules to be called with no arguments, although
this affects only runtime interpretation, not parsing.
2014-05-13 08:16:50 -07:00
Andrew Waldron
8189e12312 32552 (updated by 32560): fix segfault when using process substitution in anonymous function argument list
Also disallow process substitution in function name position.
2014-04-18 07:30:36 -07:00
Peter Stephenson
2afa556d8f 31696: In "test" No One Can Hear If You Shriek.
Treat ! as a string in "test ! -a ..." and "test ! -o ...".
2013-09-04 20:16:58 +01:00
Peter Stephenson
4095e175b6 31574: alternative fix for bad fd if no FD_CLOEXEC.
Remove dump records more consistently in that case.
2013-07-25 09:45:33 +01:00
Peter Stephenson
39ab9952e8 31545: Use of FD_CLOEXEC to remove possibility of fd reuse.
File descriptors of mmap'd dump files are closed if and only if
an exec is performed.
2013-07-20 23:23:18 +01:00
Peter Stephenson
841e60c340 this prevent process-based features from working in their arguments 2012-12-21 11:28:33 +00:00
Peter Stephenson
cd0c6153e0 30735: array substitutions aren't simple:
prevent crash on process substitution therein
2012-10-25 08:54:31 +00:00
Peter Stephenson
4b86cc48f7 30726: make shell options passed to emulate stick along with the emulation 2012-10-11 20:14:01 +00:00
Peter Stephenson
eb562c9f2c 30715: use enum lextok for variables containing lexical tokens 2012-10-05 21:35:05 +00:00
Peter Stephenson
d48faef8cd 29633: more care with anonymous and other functions 2011-08-03 18:45:17 +00:00
Peter Stephenson
7d1480af54 29626: arguments to anonymous functions shouldn't be parsed as command words 2011-07-28 09:20:02 +00:00
Peter Stephenson
6062529d3f 29492: add argument handling to anonymous functions 2011-06-19 20:12:00 +00:00
Peter Stephenson
962624e8c3 29491: remove some variables set but not used 2011-06-19 16:26:10 +00:00
Peter Stephenson
a7bc22ca00 Paul 28538 / me 28540 / couple of unposted casts:
use char * for pointer arithmetic rather than void *
2010-12-20 10:28:43 +00:00
pdpennock
d234059b1c 28338: keep =~ from inverting sense of subsequent tests (after &&/||) 2010-10-10 00:05:24 +00:00
Peter Stephenson
f1495f5099 28259: Finally fix some ancient problems with here-documents 2010-09-14 14:46:26 +00:00
Wayne Davison
693fd5b56e Check the return value of all pipe(), read(), and write() calls.
Gets rid of all the remaining "ignoring return value" compiler
warnings, and makes some read/write operations safer by ensuring
that an EINTR is handled.
2009-12-16 18:39:06 +00:00