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
Sven Wischnowsky
39e152d297
make zcompile unlink() the zwc file first (in case it is currently mapped we don't want to overwrite it); also, create the file read-only (14952)
2001-06-18 07:34:34 +00:00
Bart Schaefer
9fbdcb5311
Fix problems with zwcstat() on systems that do not USE_MMAP.
2001-06-09 18:06:32 +00:00
Clint Adams
975c0b44c5
14813: autoload functions from deleted .zwc files
2001-06-08 18:34:53 +00:00
Sven Wischnowsky
a2a1c2411a
calculate the length of the region to map (for mapped zwc files) correctly, including the offset-page-boundary-adjustment (14346)
2001-05-15 08:38:59 +00:00
Sven Wischnowsky
33ec971c33
two optimisations
2001-03-07 12:58:40 +00:00
Sven Wischnowsky
684c9eebe5
make the parser use real memory for the ecbuf to avoid having hrealloc() throw away lots of memory (13576)
2001-03-06 13:00:40 +00:00
Sven Wischnowsky
bdaa4f4c05
*** empty log message ***
2001-01-22 12:03:55 +00:00
Sven Wischnowsky
757168e2c8
remove 13108 (trap queues); replace with signal queueing to ensure that user signal handlers are only executed when it is safe to run them (13365)
2001-01-16 13:44:18 +00:00
Peter Stephenson
0c96a1b963
Joel Smith: 13230: avoid name clashes with Linux kernel
2000-12-05 10:34:23 +00:00
Sven Wischnowsky
a98a3049d9
don't return invalid Eprog after parse error (12898)
2000-10-05 09:31:21 +00:00
Peter Stephenson
4f1aa826f5
Andrej: Dynamic loading on cygwin
2000-08-02 18:01:51 +00:00
Sven Wischnowsky
6585bea1fb
fix parsing of `time' without a command (12337)
2000-07-21 07:50:07 +00:00
Wayne Davison
eaea5cc0db
Define aliasspaceflag, and init it in parse_event().
2000-07-19 20:40:18 +00:00
Sven Wischnowsky
0f398e9d2f
fix for `foo () print bar' (function definitions without braces) (12125)
2000-06-29 12:08:25 +00:00
Sven Wischnowsky
5f81bbc869
nix kaboom with `time time' (?)
2000-06-14 09:26:55 +00:00
Bart Schaefer
47532f255e
11606: Propagate parse errors out of parse_list() and parse_event(), and
...
test that it worked.
2000-05-27 08:32:58 +00:00