1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-26 05:51:08 +02:00
Commit graph

195 commits

Author SHA1 Message Date
Peter Stephenson
e44600d9aa 41661: Need to remove tokens before using bufferwords() for (z) 2017-09-10 18:01:39 +01:00
Barton E. Schaefer
207263a61e 40929 (replaces 40598): paramsubst() should always return scalar when PREFORK_SINGLE was passed in from prefork()
Previous commit (74fe4d09) consumed too much of the input linked list,
leading to later expansions being skipped.  This commit converts from
array to string sooner, but may thereby alter rc_expand_param and array
element uniqueness behavior.
2017-04-02 14:43:27 -07:00
Barton E. Schaefer
420fc41b7c 40832: fix $x:P when PWD=/ 2017-03-11 14:40:12 -08:00
Peter Stephenson
f3f8537cfa 40760: Always tokenize unquoted - to Dash.
This fixes use of pattern match character ranges in unusual contexts.

Attempt to detect a tokenized - in cases where we don't care.
2017-03-07 10:43:58 +00:00
Barton E. Schaefer
4b8db48c6b 40640: the (A) parameter flag forces array result even if assignment syntax is not used 2017-02-25 15:56:50 -08:00
Barton E. Schaefer
74fe4d0950 40598: paramsubst() should always return scalar when PREFORK_SINGLE was passed 2017-02-20 13:26:49 -08:00
Barton E. Schaefer
b3c186028e 40593: SHWORDSPLIT + unset IFS should cause default splitting of $@ 2017-02-20 13:26:49 -08:00
Peter Stephenson
4d6097657c 40375: autoload with explicit path mustn't trash already loaded function.
Also remove unnecessary dupstring() on already duplicated string
when expanding =cmd.
2017-01-18 09:57:55 +00:00
Barton E. Schaefer
c4dba4f2e6 users/22319: ${ary1:^ary2} should not change isarr state of expansion of ary1
Unless ary1 is made from a scalar, semantics of (@) in double quotes is lost.
2017-01-03 14:44:12 -08:00
Barton E. Schaefer
a409adc33b 40071: change Dash back to "-" before evaluating named directory expansions 2016-12-03 15:00:46 -08:00
Barton E. Schaefer
3ba86f4db4 40034: clear badcshglob when ignoring errors 2016-11-29 12:35:57 -08:00
Eitan Adler
110ffae9fe 40035: Cosmetic fixes for comments and documentation.
Mostly fixes to doubled words.
2016-11-29 17:13:52 +00:00
Peter Stephenson
921b39ac6b 39949: Special case for "-" in directory names.
It can be sh-tokenized to Dash to allow for appearing in ranges
after substitution, so needs to be turned back to "-" in that case.
2016-11-15 18:01:32 +00:00
Julien Cretin
a96e34b459 39579: Fix string calculation for parameter quoting.
Where there was no closing quote the size or position of the null
could be wrongly calculated.
2016-10-06 10:57:10 +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
a4b8ee13be zsh-users/21903: Fix ${...?...} in interactive shell.
On failure should abort back to top level, but we reset the error
flag around commands.  Add a hard error flag that's only reset at top level.
2016-09-14 10:33:18 +01:00
Daniel Shahaf
f368720b8b 39252: internal: quotestring: Drop the 'e' parameter, which no caller uses. 2016-09-11 09:22:18 +00:00
Barton E. Schaefer
fa48711e31 39115: repair forced joining when (@) and (j) are used together 2016-08-29 08:34:03 -07:00
Daniel Shahaf
7154052ebe 39046 + 39061: New :P history modifier. 2016-08-22 03:34:30 +00:00
Barton E. Schaefer
a1a58dde6a 39035: ${(A)name=word} should expand as an array even when there is only one element. 2016-08-12 16:10:26 -07:00
Barton E. Schaefer
68e14c41f2 39028: more join/split cases fixed and tested. 2016-08-12 00:55:32 -07:00
Barton E. Schaefer
f7c3aa170b 39019 (cf. PWS 39013): fix SHWORDSPLIT regression introduced by workers/29313
Also add test cases for more join/split combinations
2016-08-10 18:33:04 -07:00
Daniel Shahaf
1a368bf31f 38973: Optimize indexing array parameters.
% () { for 1 in $prefix/zsh/bin/zsh Src/zsh; do $1 -f -c 'a=( {1..1000000} ); repeat 3 time ( repeat 300 : $a[1]  )'; done }
( repeat 300; do; : $a[1]; done; )  1.68s user 0.01s system 98% cpu 1.718 total
( repeat 300; do; : $a[1]; done; )  1.69s user 0.01s system 99% cpu 1.710 total
( repeat 300; do; : $a[1]; done; )  1.69s user 0.01s system 99% cpu 1.714 total

( repeat 300; do; : $a[1]; done; )  0.00s user 0.01s system 72% cpu 0.022 total
( repeat 300; do; : $a[1]; done; )  0.00s user 0.01s system 72% cpu 0.022 total
( repeat 300; do; : $a[1]; done; )  0.01s user 0.01s system 69% cpu 0.023 total
2016-08-01 08:01:28 +00:00
Barton E. Schaefer
984c18048b 38599: skip the "no such named directory" warning when NO_EXEC is in effect 2016-06-04 09:51:23 -07:00
Daniel Shahaf
9e7cefcc95 unposted: internal: Document modify(). 2016-06-03 20:39:25 +00:00
Peter Stephenson
dc2397f754 users/21352: ensure $'' doesn't get elided.
Assign nulstring to it if empty.  Test for all forms of quotation
marks.
2016-03-07 09:44:54 +00:00
Peter Stephenson
f5b8efa7e0 37344: restore old printable quoting, add ${(q+)...}.
The \C- form is only used inside quotedzputs().

${(q+)...} outputs a quotedzputs() representation.
2015-12-07 21:49:07 +00:00
Barton E. Schaefer
bc30d6bfca 37206: fix ${(t)param} for "typeset -H param" 2015-11-23 19:18:44 -08:00
Peter Stephenson
d814071b14 37096: Another $${(P)...} tweak.
Make a top level (P) work with nested ones, i.e. ${(P)${(P)...}...}
2015-11-12 14:28:15 +00:00
Peter Stephenson
7a951ef93e 37094: Further tweaks to parameter name references.
Safety in array test.

Make nested references work.

Add parameter tests.
2015-11-11 22:14:16 +00:00
Peter Stephenson
830d54e629 37092: make nested ${(P)name} properly refer to parameter on return 2015-11-11 18:04:20 +00:00
Peter Stephenson
e8d6041f69 37074: extend previous fix to over whitespace at end 2015-11-07 18:05:43 +00:00
Peter Stephenson
0fcc6c8fb2 37073: another SH_WORD_SPLIT problem.
In cases like x${:- y} the space was simply removed instead of
being used for splitting.
2015-11-06 17:28:02 +00:00
Barton E. Schaefer
a9add3de54 35694: fix handling of history modifiers applied across all elements of an array parameter value 2015-07-06 16:35:05 -07:00
Peter Stephenson
75cafccc0a 35343: Avoid $#name length handling for POSIX_IDENTIFIERS 2015-05-31 16:40:14 +01:00
Peter Stephenson
e88610b786 35326: $#- was misparsed as ${#-} 2015-05-29 16:06:47 +01:00
Peter Stephenson
0da0a0b9c7 35153: nested math substitution 2015-05-15 10:19:53 +01:00
Peter Stephenson
59a874f94e 35151: improved check for parameter q and b flags 2015-05-15 09:58:17 +01:00
Peter Stephenson
6269db883a 35067: Add (b) parameter flag for pattern char backslashing.
Doc tweak from Daniel in 35071.

Includes test.
2015-05-10 19:19:34 +01:00
Peter Stephenson
6fa63a0ce2 34606: fix up nested arithmetic substitution
Arithmetic within a parameter substitution is a special
case that needs fixing with the introduction of the new
Inparmath token.

Add test.
2015-02-22 21:32:08 +00:00
Peter Stephenson
2cbf9d7e65 34573: Safer failure to handle command substitution 2015-02-19 12:01:16 +00:00
Peter Stephenson
52e938bac9 34570: Another nasty command / math substituion thing.
Mark arithmetic substitutions with tokens to make sure the substitution
go knows what to do.  Before it was guessing by counting the
parentheses at the end.
2015-02-19 10:22:40 +00:00
Peter Stephenson
c6c9f5daf2 34322: bug with interface to parsestr() etc.
Was showing up in places like ${(e)...} where command substitution
could reallocate the token string, but actually there was never any
guarantee that the lexer wouldn't do that, so this was always
a bit iffy.
2015-01-18 22:38:57 +00:00
Mikael Magnusson
6c72895bc2 34105: subst: remove dead code
Found by Coverity (Issue 1255810).
2015-01-06 23:46:55 +01:00
Barton E. Schaefer
7e7449592a 34103: fix ancient double-quote handling thinko in subst_parse_str()
This doesn't seem to have mattered, but must in some obscure cases
2015-01-06 09:34:12 -08:00
Barton E. Schaefer
36ec763dbd 33976: fix overlapping strcpy() 2014-12-15 16:41:08 -08: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
Peter Stephenson
3b5d77d819 33423: expand ${(p)...} to allow ${(ps.$param.)...} 2014-10-12 17:52:11 +01:00
Barton E. Schaefer
5a9f3ac773 33118: record original param unset state when treating empty the same as unset,
to avoid incorrect NO_UNSET errors
2014-09-06 22:15:28 -07:00
Peter Stephenson
b516dc37ac unposted: remove unused variables 2014-08-04 18:54:02 +01:00