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
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
Peter Stephenson
d296535d38
23313: fix test for incorrect version in ZWC file
2007-04-23 17:09:12 +00:00
Peter Stephenson
3db1a442a4
parse.c
2007-04-23 16:55:00 +00:00
Peter Stephenson
e7210e10b0
23312: fix versioning and initialisation of word code headers
2007-04-23 16:44:24 +00:00
Peter Stephenson
de272e0309
23115: ";|" at end of case clause causes later patterns to be tested
2007-01-19 21:36:00 +00:00
Peter Stephenson
596d38fb07
22586: fix warnings spotted on Cygwin
2006-08-04 13:38:26 +00:00
Peter Stephenson
0a22eb0e0c
22546: fix {myfd}>... bug and tweak tests
2006-07-11 15:36:37 +00:00
Peter Stephenson
4a67f24798
22544: Improve use of ztype tests for multibyte characters. Add
...
POSIX_IDENTIFIERS option to control allowability of multibyte
alphanumeric characters in parameter and module names.
2006-07-10 13:08:22 +00:00
Peter Stephenson
9d5f320f38
22542: deoverenthuse cmdpopping
2006-07-09 14:47:22 +00:00
Peter Stephenson
bd50a3c516
22516: error in func() didn't pop command stack
2006-06-26 10:04:09 +00:00
Peter Stephenson
dd5602f59b
22474: use variable argument lists to improve error message handling
2006-05-30 22:35:03 +00:00
Peter Stephenson
8569055841
users/10087: no aliases for case of "in" in "case"
2006-03-26 19:03:15 +00:00
Wayne Davison
4cb83571c4
Changed some structures to avoid gcc's type-punned warnings.
2006-03-07 21:30:36 +00:00
Bart Schaefer
38d2734e0a
Remove excess argument of zwcstat()
2005-04-24 18:39:02 +00:00
Peter Stephenson
b3f8e32e5c
21133: New {myfd} syntax for allocating file descriptors
2005-04-12 15:11:07 +00:00
Peter Stephenson
05b06b1c08
fix autoloaded trap bug; rejig use of trapfuncs
...
(now traplists); improve trap tests
2005-02-06 20:36:09 +00:00
Bart Schaefer
684da738b0
20418: report parse error rather than crash on unfinished pipelines.
2004-10-02 21:44:13 +00:00
Peter Stephenson
241aa1d40d
20214: fix debugging test with recursive functions
2004-07-28 10:34:31 +00:00
Peter Stephenson
7f26993e99
20112 changed c.f. 20113:
...
fix here string and here document expansion and quoting
2004-06-28 15:38:10 +00:00
Peter Stephenson
d591334e9d
20076, 20084: { ... } always { ... } syntax.
2004-06-22 13:09:55 +00:00
Wayne Davison
fb0937a69e
Marked unused parameters with the new UNUSED() macro.
2004-06-02 22:14:25 +00:00
Wayne Davison
fea94cd79f
Fixed two signed/unsigned comparisons.
2004-05-28 19:20:29 +00:00
Oliver Kiddle
95231270ed
19595: rename DO to DOLOOP to avoid conflict with curses.h on Tru64 5.1
2004-03-11 14:25:12 +00:00
Peter Stephenson
815bc92148
a la 19209: zcalloc -> zshcalloc
2003-10-29 19:17:30 +00:00
Peter Stephenson
40c29457f2
18251: Fix select and make it respect EOF
2003-02-17 11:41:58 +00:00
Bart Schaefer
d4c7657014
17760: Fix case-pattern parsing bug in sh emulation.
2002-10-06 18:38:14 +00:00
Peter Stephenson
9634760d5e
17582: Improved option argument handling.
...
unposted: Updated version to 4.1.0-dev-6 because of interface change.
2002-08-27 21:10:30 +00:00
Oliver Kiddle
af0697b705
17503: fix various typos and spelling mistakes in source code comments
2002-08-05 12:35:59 +00:00
Peter Stephenson
0e08b8c2e4
17299: Use reference counts in Eprogs so as to be able to free them as soon
...
as finished with.
2002-06-07 14:44:21 +00:00
Peter Stephenson
07047de129
17283: Src/parse.c: `func() { ... } this bit was ignored'.
2002-06-04 16:25:46 +00:00
Peter Stephenson
da6a201946
17272: inner function definition could define nonsense
2002-06-02 18:03:20 +00:00
Bart Schaefer
2260fe045e
Fix parsing of binary infix operators of test builtin.
2002-03-07 16:20:00 +00:00
Oliver Kiddle
52b8303537
16353: add += parameter assignments
2001-12-17 17:17:38 +00:00
Bart Schaefer
01ce2a758c
16249: Clear here-documents on parse error.
2001-11-21 17:03:56 +00:00
Sven Wischnowsky
ab14a745a6
increment zwc fie version (which means changing the magic number) (15584)
2001-08-07 09:07:12 +00:00
Sven Wischnowsky
6d81779954
remove nulargs in here strings (15470)
2001-07-24 14:17:31 +00:00
Peter Stephenson
003ec8c7e8
15327: always use local LINENOs in parse_string().
2001-07-09 16:05:13 +00:00
Peter Stephenson
f486329a16
15265: Src/parse.c: correction problems with new `for' syntax
2001-07-06 09:40:01 +00:00
Peter Stephenson
1897a361bf
15030: multi-parameter `for' loops
2001-06-25 16:07:51 +00:00
Bart Schaefer
e25f86419e
No POSIX "for" syntax with csh syntax.
2001-06-21 10:54:49 +00:00
Bart Schaefer
6c074dfaf3
POSIX "for" syntax.
2001-06-21 10:09:08 +00:00