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
Peter Stephenson
51409732d0
27284: better use of movefd()
2009-09-22 09:17:05 +00:00
Peter Stephenson
f43022eec0
users/14240: assignment before a function definition is an error
2009-07-17 20:32:33 +00:00
Peter Stephenson
c6a3ccc8d7
27092: missing then-clause for if wasn't an error
2009-07-06 20:44:28 +00:00
Peter Stephenson
10182c766b
c.f. 26586: rename yylex to zshlex and yytext to zshlextext
2009-02-25 10:23:58 +00:00
Peter Stephenson
c7d8b0dfb8
26546, 26556: sticky emulation for functions defined in emulate ... -c ...
...
environments, plus documentation
2009-02-11 20:42:15 +00:00
Peter Stephenson
14231691e1
26061: fix clash between process subst and numeric glob
...
26062: additional compmatch change, missed from 26047
2008-11-18 10:07:31 +00:00
Peter Stephenson
59dd1491c6
users/13295, tweaked: dont reset line numbers when parsing strings, sometimes
2008-09-29 08:46:21 +00:00
Peter Stephenson
d17398b442
users/13288: Src/parse.c: don't report parse errors on aborted lines
2008-09-24 19:19:56 +00:00
Peter Stephenson
8bb15c1392
25641: add emulation option (NO_)MULTI_FUNC_DEF
2008-09-11 12:49:05 +00:00
Peter Stephenson
1f81bdcb47
25587: fix a==(stuff) and associated stuff.
2008-09-01 20:18:46 +00:00
Peter Stephenson
2e3363ef7d
25571: when parsing use line numbers for the start of a token, not the end
...
add test and move debug trap tests to new file
2008-08-31 19:50:47 +00:00
Peter Stephenson
2853ca830a
25247 with further modifications: add $funcsourcetrace
2008-08-11 19:22:54 +00:00
Peter Stephenson
1a9386290b
25262: suspicious error checking in braceless function definition
2008-07-01 18:38:39 +00:00
Peter Stephenson
948f015df0
24711: fix re-presentation of here-documents munged internally
...
to here-strings
2008-03-14 11:40:57 +00:00
Peter Stephenson
b24d545294
users/12412: check for extra arguments in test and [
2008-01-10 18:53:49 +00:00
Peter Stephenson
4d52b7ebe6
23670: rationalise some linked list functions
2007-06-27 13:56:10 +00:00
Peter Stephenson
a755310d20
Phil Pennock: 23480: typo
...
Also typo in mod_stat.yo
2007-05-29 09:27:43 +00:00
Peter Stephenson
7f03c3d851
23375: Phil Pennock: =~, zsh/regex etc. etc.
2007-05-01 22:05:03 +00:00
Peter Stephenson
eea55e45be
unposted: fix error message for short ZWC file
2007-04-23 17:24:22 +00:00