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

184 Commits

Author SHA1 Message Date
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
Mikael Magnusson b8751cb9d7 32949 (wip 32928, 32937): Add :^ syntax for zipping two arrays 2014-08-04 19:00:01 +02:00
Peter Stephenson b79ef8caaf 32932: add hmkarray() and use to fix leak 2014-08-01 16:15:13 +01: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 22b8fd6da9 32299: add use of underscores on arithmetic output for spacing 2014-01-23 10:32:59 +00:00
Peter Stephenson bd919f30ae 32001: fix crash on ${:*} and ${:|} 2013-11-17 20:33:57 +00:00
Peter Stephenson 44757a653c 30993: fix parameter modifier crash with :wq on empty string 2013-01-22 16:28:58 +00:00
Peter Stephenson eb562c9f2c 30715: use enum lextok for variables containing lexical tokens 2012-10-05 21:35:05 +00:00
Peter Stephenson 6f3ff6b653 30633: "functions -T" only traces marked function, not called functions 2012-08-21 18:03:01 +00:00
Peter Stephenson e49e41725a unposted: add test for valid identifier to 30431 2012-04-22 20:49:39 +00:00
Peter Stephenson cb4ff5e970 30439: ${...:*...} with nonexistent or non-array after *
should return no results
2012-04-22 18:39:53 +00:00
Peter Stephenson 5eb53bf88d 30431 with typo in _typeset fix:
add ${...:|...} and ${...:*...} operators, as documented
2012-04-22 18:10:42 +00:00