1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-18 15:21:16 +02:00
Commit graph

146 commits

Author SHA1 Message Date
Daniel Shahaf
edc04bd946 45291: A glob with a trailing slash will now match unreadable/unexecutable directories. 2020-01-15 19:20:33 -06:00
Daniel Shahaf
b591d43113 45181: Fix workers/45164: ${(S)%%} will now consider the empty string as a potential match. 2020-01-02 16:00:11 +00:00
Peter Stephenson
273d669a56 45001: Fix zero-length matches with ${...%...}
As the shortest match is preferred, zero-length matches beat any other.
2019-12-12 10:23:47 +00:00
Martijn Dekker
c578f0a08b 45004: Fix typos in comments 2019-12-11 02:37:39 +00:00
Peter Stephenson
b8dc5a7f6d 44435: Handling digita arguments for :h and :t.
Pick number of leading or trailing path components to substitute.
Active in history, brace parameters, glob qualifiers.

Add tests for all three environments.
2019-06-20 11:13:05 +01:00
Daniel Shahaf
3d7215cc82 43091: In the (u) glob qualifier, expand and correct "unknown user" error messages. 2018-06-25 11:18:41 +00:00
Dima Kogan
487489c522 stat() for glob qualifiers lost information in corner case 2017-11-20 09:59:51 +00:00
Peter Stephenson
a3b3f00575 41420: "{.." wasn't check for brace expansion properly 2017-07-13 17:20: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
adab02817f 40819: Fix IS_DASH test in BRACE_CCL handling 2017-03-10 10:43:25 +00: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
e51c9c17af 40453: signal handler safety for callers of patcompile(PAT_STATIC), which is not re-entrant. 2017-01-29 08:30:14 -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
a62e1640bc 39958: Add extra byte to PATH_MAX allocations.
This ensures we've got enough space for a null, although this
isn't always needed.
2016-11-17 19:49:17 +00:00
Peter Stephenson
39ae9cd10a 39723: metafy string passed to pattern in complist.
Also additional safety tokenizing a string with Meta characters.
2016-10-25 11:53:49 +01:00
Peter Stephenson
895e9beb29 users/21793: Remove raw integers as glob qualifiers.
There was an ancient undocumented feature that these were treated
as a file mode to "or" with that of the file under test.  The
only documented way of doing this has always been the "f" qualifier,
so removed the effect of raw integers to make errors more obvious.
2016-07-28 09:51:19 +01:00
Peter Stephenson
317494e998 38853: use strchr() 2016-07-20 09:45:37 +01:00
Peter Stephenson
72e5fe7aab 38879: Unmetafy file names for glob sort.
Test using Polish UTF-8 collation sequence that'w known to
cause the problems.
2016-07-18 16:57:38 +01:00
Jun-ichi Takimoto
a4020e10a3 37868: add 'static' to file local variables 2016-02-03 01:25:33 +09:00
Peter Stephenson
c2b6bd51f9 37693: turn Dash into '-' in glob qualifiers 2016-01-19 17:38:59 +00:00
Peter Stephenson
ad16356e19 37689: ! and ^ need to be tokenised in character sets 2016-01-19 17:24:12 +00:00
Peter Stephenson
8eb9070d67 37678: Now possible to quote "-" in pattern range 2016-01-19 09:55:46 +00:00
Barton E. Schaefer
b4643fce2d 37483: save and possibly restore cshnullglob failure state around each evaluation of an (e:...:) glob qualifier. 2016-01-01 19:20:14 -08: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
58f4cccb1f 37022: add GLOB_STAR_SHORT option to abbreviate ** and *** 2015-10-30 12:28:07 +00:00
Peter Stephenson
5336587307 36711: Allocate unmetafied pattern trial string on the heap 2015-09-30 10:19:16 +01:00
Barton E. Schaefer
a5a6c58ff8 unposted: fix typo in comment. 2015-09-29 13:36:43 -07:00
Peter Stephenson
d07783628e 36700: unmetafy early for parameter match 2015-09-29 19:47:21 +01:00
Peter Stephenson
f9d7651c25 36682: expand pattern interface to optimise unmetafication 2015-09-28 20:31:51 +01:00
Mikael Magnusson
bd5806aa0a 36603: glob: fix dirfd leak during Y shortcut qualifier 2015-09-24 20:52:56 +02:00
Jun-ichi Takimoto
8b1676e3b7 36491: Multibyte support for parameter expansion flags B,E,N 2015-09-12 20:35:56 +09:00
Peter Stephenson
c0df3440a4 36264: glob and pattern variable pathbuf is metafied.
Document this and unmetafy it when passing to system calls, including
lchdir() which is a system-level interface.
2015-08-21 15:17:18 +01:00
Barton E. Schaefer
45424e735d 36084: use zrealloc() consistently 2015-08-10 12:55:56 -07:00
Barton E. Schaefer
df5f825538 36033: a few more queue_signals() to protect global state changes 2015-08-09 17:37:23 -07:00
Peter Stephenson
f1923bdfa6 Add non-metafied character length handling.
Use this in regex module and add test using $'\ua0'.

Rename mb_metacharinit() to mb_charinit() as it does not involve
metafied characters.
2015-06-12 09:30:39 +01:00
Barton E. Schaefer
fae07f65a3 34965: consistent use of zalloc/zrealloc/zfree 2015-04-25 12:40:35 -07:00
Barton E. Schaefer
1fa68938dc 34837: avoid loss of original file path when applying colon-modifiers in glob qualifiers 2015-04-03 09:55:11 -07:00
Barton E. Schaefer
628d2f4f8a 34634: avoid infinite recursion on (/)# extendedglob 2015-02-27 10:10:19 -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
Barton E. Schaefer
9ddd022ff0 33854: errors end recursion through scanner()
Makes **/ more easily interruptible
2014-12-07 11:20:01 -08:00
Peter Stephenson
691a7e4b3d users/19143: fix depth glob search with trailing slashes 2014-09-25 19:12:34 +01:00
Mikael Magnusson
78dd672e1a 33136: P glob qual appends words when negated 2014-09-16 00:27:05 +02:00
Mikael Magnusson
33ad7174f6 33038: Fix {^@..a} hanging 2014-08-21 01:23:32 +02:00
Barton E. Schaefer
417cb94fe1 32931: with NO_NOMATCH, a subscript glob qualifier on a not-matching pattern returns the original pattern 2014-07-31 23:46:21 -07:00
Jun T
e6d7d7b013 32767: another spot to tweak bracechardots() 2014-06-11 10:19:24 -07:00
Barton E. Schaefer
d1da134c63 32766: bracechardots() agrees with xpandbraces() about what constitutes a {C1..C2} pattern, thus preventing crash 2014-06-10 23:52:38 -07:00
Jun T
e1fbf76de0 32765: fix build when not MULTIBYTE_SUPPORT 2014-06-10 23:46:15 -07:00
Barton E. Schaefer
32756f78af 32723: add braces around some if/else branches 2014-06-05 21:10:23 -07:00
Daniel Shahaf
69378db3c5 32708: glob qualifier (Y) implies (oN)
plus incidental patch to avoid adding a meaningless bitvalue to sort-order flags
2014-06-04 22:47:20 -07:00