1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-23 16:36:05 +02:00
Commit Graph

60 Commits

Author SHA1 Message Date
Dimitris Apostolou 356dcb20ce github #82: Fix typos 2021-11-12 23:54:34 +01:00
Peter Stephenson db46c9cd58 49353: Fix comments in sourced file.
If the file was sourced from an interactive shell with
INTERACTIVE_COMMENTS not set, comments were not parsed.

Note there is a remaining edge case where the sourced
file is in fact entered at the comment line.
2021-09-09 20:05:39 +01:00
Peter Stephenson 9e38ab8178 48787: Fix command status after failed if
If "if" had a hard error in the condition, and there was no
else clause, the command status was incorrectly cleared to zero.

Add test.
2021-05-06 10:03:27 +01:00
Peter Stephenson 2a9674862e 45616: Remove token from count argument to repeat 2020-03-26 20:54:37 +00:00
Daniel Shahaf 7ca2b06501 45304: Do execute the always block even when the try/always block itself is the last command.
Fixes the test added in the previous commit (workers/45305).
2020-01-16 18:29:13 +00:00
Daniel Shahaf 28e11ac60b 45305: Add an XFail test: The exec-last-command optimization is applied to try/always. 2020-01-16 18:21:11 +00:00
Daniel Shahaf a0c0aa41d2 45111: zshmisc(1): Clarify the documentation of 'return' and 'exit' in conjunction with try/always
Having reviewed 20076, 20084, 21734, and 21735, my understanding is that
the original intention was:

- A 'return' in a function does run always-list
- An 'exit' outside a function does not run always-list
- A 'return' outside a function is treated as an 'exit'

All of which are the case today.  The remaining case, of 'exit' used
inside a function, was not specified by the referenced -workers@ posts;
does, as implemented, run the always-list; and furthermore, based in
21734 it's fair to assume that the original documentation was assuming
that 'exit' would be used outside of any function, just like it assumed
'return' would be used inside a function.

Therefore, have the documentation specify only the behaviour of 'exit'
outside any function, and leave the behaviour of 'exit' inside
a function unspecified.  Anyone who relied on the documentation of 'exit'
as documented until this commit would have run into the
documentation/implementation discrepancy described in 45075.
2019-12-22 03:21:09 +00:00
Daniel Shahaf 26ec82730d unposted: Group related tests. No functional change. 2019-12-21 11:37:21 +00:00
Oliver Kiddle a531a1ec2d 44345: fix wordcode traversal where ! without a following command could result in a crash 2019-05-23 01:05:01 +02:00
Peter Stephenson 588bb77cb6 44271: Fix breaks propagated from until or return.
If the until or return test caused continuation but there was
a pending return, breaks didn't get cancelled causing enclosing
scope to skip commands.
2019-05-03 20:34:53 +01:00
Daniel Shahaf 73b1328049 43726: Add tests for semicolon in the middle of a sublist not terminating it. 2018-10-24 15:31:42 +00:00
dana cb04ae40af add millisecond and microsecond options to TIMEFMT variable 2017-12-14 15:36:46 +00:00
Peter Stephenson c9df6bc8d4 41662: exec -a arguments weren't sanitised 2017-09-10 18:02:52 +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
Peter Stephenson ed4e37e45c 41020: Fix "command -p"; "-p" was incorrectly left in command arguments
Also add tests for known precommand modifier issues.
2017-04-28 10:22:43 +01:00
Peter Stephenson 48b0daf3d4 41016: Test that quoted precommand modifiers now work 2017-04-27 09:58:45 +01:00
Peter Stephenson 408b92b168 41008: Handle expansions for precommand modifiers 2017-04-26 09:44:38 +01:00
Martijn Dekker 31c6cfca9c 39625: case needs to reset lastval if no pattern matched 2016-10-13 10:49:02 +01:00
Peter Stephenson 8f2ce89a0c 39599: Don't reset status before "case" execution 2016-10-10 10:55:48 +01:00
Peter Stephenson 36a11804b4 39521: Refactor start of execcmd().
By splitting into _analyse and _exec execpline2() has easier
access to the state at the start of execution.  Use this
to ensure we fork if this is a builtin with no arguments.
2016-10-03 09:59:01 +01:00
Peter Stephenson bb2bbcc944 39517: back off 39502 (WC_ASSIGN causes fork in pipe).
This isn't a robust fix as WC_ASSIGNs simply precede the main wordcode.
2016-09-30 11:34:15 +01:00
Peter Stephenson 6ce696f352 39502: Fork for assignment in LHS of pipeline.
foo=bar | stuff

left the value of foo set to bar as we didn't realise we needed to
fork.
2016-09-29 17:29:58 +01:00
Peter Stephenson 07c8fbe596 34943: Fixes for "command" with multiple options.
These need to combine properly, and alos "command -p" with either
-v or -V needs to search for builtins and then using the default
system path.
2016-09-29 11:01:00 +01:00
Peter Stephenson 016929e043 38734: fix final case clauses terminating with ;& 2016-06-21 16:12:51 +01:00
Barton E. Schaefer c0a80171ee 35953: fix handling of command substitution in math context 2015-07-29 22:36:45 -07:00
Peter Stephenson 9152ff3b46 35760: Add ZTST_skip to test system 2015-07-10 14:47:19 +01:00
Peter Stephenson f2b2271fbe Turning case parsed as multiple alternatives back into text.
Also add test.
2015-07-04 11:01:47 +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 ec57c91b58 users/20203: nested functions in always blocks when exit pending 2015-05-13 16:17:04 +01:00
Bart Schaefer e349201f9a 29025: Test/A01grammar.ztst: in select test, assert LINES=3 to print list 2011-04-22 06:00:27 +00:00
Peter Stephenson 73ebca4fe9 28783: allow parentheses to be special in more places with SH_GLOB 2011-02-21 11:32:47 +00:00
Peter Stephenson db65bef413 unposted: fix new test in A01grammar.ztst 2010-03-18 16:30:50 +00:00
Peter Stephenson 53745d8df0 27793 and follow ups: add PATH_SCRIPT option to find script using $PATH 2010-03-16 09:43:51 +00:00
Peter Stephenson bdfebe3e32 27129: fix status at start of function, command subst, etc. 2009-07-11 16:42:53 +00:00
Peter Stephenson 4db28c55b6 27126: a few more contexts where executing empty lists gives status zero 2009-07-10 22:10:25 +00:00
Peter Stephenson 73be7ee553 27106: reset status on command that expands to empty
27122: add POSIX_JOBS option
2009-07-10 11:08:39 +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 5c5a388ed7 27087: change return codes from failed "." 2009-07-02 13:46:36 +00:00
Peter Stephenson 041057687f 27083: non-zero status on failures to find or execute file in "." 2009-07-01 15:07:25 +00:00
Peter Stephenson 74eaa20404 26858: use zsh instead of sh in exec -l test 2009-04-21 10:37:36 +00:00
Peter Stephenson a85db68271 26622: improve comments within $(...) and add test 2009-02-27 10:23:58 +00:00
Peter Stephenson bab70abe6b users/12848: return, break, continue in always block override try block 2008-05-11 19:03:58 +00:00
Peter Stephenson 765f73823e users/12305: option output not well documented
-c and SHIN_STDIN inconsistent with manual
2007-12-12 13:46:35 +00:00
Peter Stephenson 52e5a75a7a 23486: use {fd} syntax to get fd's for tests 2007-05-29 14:50:28 +00:00
Peter Stephenson 8ce657c2cb Phil Pennock + tweaks: 23398 + more tweaks: exec compatibility options 2007-05-08 10:02:58 +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 7b9cff2754 21131: exit with status 127 when script not found 2005-04-11 10:23:55 +00:00
Peter Stephenson 82c9c7a423 21082: Dan Nelson: fix zsh -c exit status on parse error 2005-04-04 09:35:36 +00:00