1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-27 14:30:46 +02:00
Commit Graph

923 Commits

Author SHA1 Message Date
Oliver Kiddle
1bfcff129d 41983: fix exclusion of long options with (-) on a normal argument 2017-11-04 00:57:48 +01:00
Barton E. Schaefer
dcd4f02845 41902: ${(z)...} continues parsing on unmatched quote when CSH_JUNKIE_QUOTES is set
Tests for 41902 and 41873
2017-10-17 20:29:47 -07:00
Peter Stephenson
b3fa5c528c 41877: Separate out SH_FILE_EXPANSION loop from parameter substitution.
Parameter substitution can add nodes that need to be rescanned by
it, but not by file expansion, so the two don't play well together.
2017-10-13 18:17:09 +01:00
Barton E. Schaefer
b84d69cf52 41828, 41830: skip SHFILEEXPANSION for new nodes added by stringsubst() in prefork() 2017-10-08 18:08:09 -07:00
Oliver Kiddle
12902206b7 41824: fix to not complete rest args from an _arguments set alongside the argument to and option in a separate set 2017-10-07 22:35:59 +02:00
Peter Stephenson
174e560a23 41787 (plus minor tweaks): use $FUNCSTACK for function nesting depth.
Initialised from existing configuration value.
2017-10-02 09:44:26 +01:00
Peter Stephenson
728f2adfc8 Add typeset -p1, like typeset -p with newlines 2017-10-01 17:53:56 +01:00
Peter Stephenson
7cb55668c2 41773: Array index assignment tests for KSH_ARRAYS 2017-09-28 10:59:38 +01:00
Oliver Kiddle
80a02c10aa 41772: fix bug in handling of long options with _arguments' -A option 2017-09-28 09:31:35 +02:00
Peter Stephenson
6230e82d44 41764 (test tweaked): allow [key]+=value when modifying arrays 2017-09-27 09:41:50 +01:00
Peter Stephenson
85b0dd7133 Updates for ksh array element syntax.
Move detection of key/value pairs down into prefork().

Detect normal array assignment and [key]=val array assignemnt
separately.  Mark key / value pairs with Marker and pass up flag.  Deal
with marked triads specially later on.
2017-09-24 17:33:07 +01:00
Peter Stephenson
ab7be4238c More [key]=value tweaks
Some rephrasings.

Update typeset -p for associative arrays to use new syntax.
2017-09-14 21:43:37 +01:00
Peter Stephenson
54b3958440 First go at var=([key]=value) syntax.
Works for both normal and typeset case, also var+=...

Still to do: allow to be mixed with straight array assignment,
improve typeset -p, implement [key]+=value.
2017-09-13 20:54:00 +01:00
Peter Stephenson
2ef3dff65a 41668: New --emulate option on invocation.
This sets the shell emulation mode similarly to ARGV0=... which
doesn't work from other shells.

Note that this gives more comprehensive emulation than running
emulate within the shell.
2017-09-11 10:12:17 +01:00
Peter Stephenson
c9df6bc8d4 41662: exec -a arguments weren't sanitised 2017-09-10 18:02:52 +01:00
Peter Stephenson
e44600d9aa 41661: Need to remove tokens before using bufferwords() for (z) 2017-09-10 18:01:39 +01:00
Peter Stephenson
ea5b38935a 41641: Some math operations shouldn't be lvalues.
This includes pre- and post- increment and decrement.  Simply
mark all values after operations as rvalues.
2017-09-05 13:15:30 +01:00
Peter Stephenson
ebcea98eca Fix problem with ERR_RETURN.
It wasn't suppressed properly in the code following an if
in some circumstances, in particular in initialsation scripts
and also in a nested function where the caller had suppressed
it.
2017-08-31 16:54:19 +01:00
Peter Stephenson
7d1877da4e 41608 (plus tests): restore ERR_EXIT before function.
There was an exception to the usual ERR_EXIT pattern that causes
problems when executing a function in an else branch.  It seems
the exception is no longer needed as the regression tests pass
without it.
2017-08-29 19:52:18 +01:00
Peter Stephenson
97d4bdbc7e 41590 modified as 41595: make ERR_RETURN more logical.
It now operates separately at each function depth.

To keep ERR_EXIT global, make the noerrexit variable usd bit flags.

Extend tests.
2017-08-24 19:46:20 +01:00
Peter Stephenson
74aff4106a 41542: Fix pcre logic for extracting matched parentheses.
When we went off the end of the array but measured the length
implicitly, we got lucky before.  After 41308 we were looking up lengths
in stale memory.

Rename some variables, clean up the logic, be easier to understand.

Add tests.
2017-08-14 11:17:48 +01:00
Phil Pennock
b5f40f4156 41527 (tweaked for heap memory): fix [[ -<cond> ]] from modules 2017-08-11 15:02:06 +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
a9b579a9d3 Revert "41499 (with one further tweak): POSIX_STRINGS behaviour."
This reverts commit 2eacbef919.

Conflicts:
	ChangeLog
2017-08-08 19:04:49 +01:00
Peter Stephenson
2eacbef919 41499 (with one further tweak): POSIX_STRINGS behaviour.
Ignore a terminating delimiter when splitting as separators
despite being called separators are terminators.
2017-08-07 18:47:43 +01:00
Peter Stephenson
039a34cca5 41485: test for previous fix 2017-08-03 21:50:18 +01:00
Peter Stephenson
d4b94b5e83 41464, 41466: With POSIX_BUILTINS, exec only executes sexternal commands.
Document the default behaviour and add a test.
2017-07-27 09:22:04 +01:00
Peter Stephenson
a3b3f00575 41420: "{.." wasn't check for brace expansion properly 2017-07-13 17:20:24 +01:00
Peter Stephenson
e8edd42f7f 22760: fix partial string length reports with NO_MULTIBYTE 2017-07-02 20:29:00 +01:00
Phil Pennock
825f84c77e 41308 (tweaked): behaviour of PCRE with NUL bytes 2017-06-22 09:24:33 +01:00
Peter Stephenson
eb783754bd 41284: Fix NULL dereference in cd.
This happened in sh compatiblity mode if HOME was not set
and cd was used with no argument.
2017-06-13 15:41:00 +01:00
Peter Stephenson
1caaa933b4 unposted: Adding comments to test changed line number in output 2017-05-09 21:02:34 +01:00
Peter Stephenson
c7a9cf465d 40181: Fix buffer overrun in xsymlinks.
There was no check for copying to the internal xbuf2 for a
preliminary test.
2017-05-09 17:49:18 +01:00
Peter Stephenson
263a0c2476 41078: Empty psvar could cause bad dereference in prompt expansion 2017-05-09 09:46:23 +01:00
Peter Stephenson
af1c82d646 40173: Off-by-one error checking for {varid}.
This caused a single unprintable character in braces before a
redirection to be treated as an indentifier.
2017-05-08 18:00:55 +01:00
Peter Stephenson
641a764b82 users/22688: Allow mixing redirs and arguments after anon functions.
These are parsed differently from the case of normal functions which
can't take normal arguments at that point.
2017-05-08 17:19:22 +01:00
Peter Stephenson
f25d01a97c Fix combination of HERE document and |&.
A missing flag setting up the HERE document mean that the size
of the wordcode needed to append the 2>&1 was counted incorrectly,
so the resulting wordcode was garbled.

Add test.
2017-05-08 10:54:08 +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
d7110d8f01 41012: Fix premature exit from nested function in EXIT trap.
Also add check so we don't delay an exit if we were already in
an EXIT trap for the main shell, as we should in that case leave
immediately.
2017-04-27 18:56:18 +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
Peter Stephenson
68466f327e 40995: Don't disable alias expansion when finding command substitution limits
This is needed in some unusual cases in order to identify the exit
condition without encountering a parse error.
2017-04-23 17:06:26 +01:00
Peter Stephenson
f6ab9a281d 40932: Parameter subscripts need to count parentheses.
Otherwise they can terminate in the middle of an expression.
2017-04-03 10:04:03 +01:00
Sebastian Gniazdowski
5aec3f9742 40909: Stress test for parameter substitution 2017-03-30 12:16:24 +01:00
Peter Stephenson
e78ec8610d 40891: fix more zero-length matches.
This time at the end of the trial string.
2017-03-23 21:01:59 +00:00
Peter Stephenson
086656241c 22601: Fix for parameter substitution pattern matches.
It was not possible to math against a zero-length string in
some cases.
2017-03-23 09:35:20 +00:00
Peter Stephenson
27a55d8591 Improve comment at top of GDBM test 2017-03-21 09:57:00 +00:00
Daniel Shahaf
d044530afd 40816: Document interaction of 'print -P' and 'print -f'. 2017-03-12 19:37:18 +00:00
Jun-ichi Takimoto
2ff71e84ba 40820: add a few tests of strftime, related to 40681 2017-03-12 21:04:22 +09:00
Peter Stephenson
018992123e 40803, 40804, 40805, 40806: Parameter test additions.
Potentially dodgy string for ${(z)...} splitting from Sebastian.

Check that $- and ${-} produce plausible results.
2017-03-09 12:18:54 +00:00