summaryrefslogtreecommitdiff
path: root/Src/glob.c
AgeCommit message (Collapse)AuthorFilesLines
2024-03-1852750: remove ansi2knr support for old pre-ansi K&R compilersOliver Kiddle1-4/+4
2023-10-2652244: Fix a batch of minor defects reported by Coverity.Bart Schaefer1-1/+2
Coverity defects 1547831, 1547826 (remove unused function), 1521551, 1500752, 1500747, 1401549, 1372423, 1270645, 1255799, 1255792, 1255789, 1255787, 1255782, 1255750
2022-12-1651212: remove STOUC() macroOliver Kiddle1-2/+2
This served as a workaround for ancient compilers where casts to unsigned char were broken.
2022-12-0251080: allow multibyte chars in glob qualifier (u:uname:)Jun-ichi Takimoto1-1/+1
2022-04-0549994: Single-byte equivalence of users/22601 and workers/40891Bart Schaefer1-2/+2
2022-04-0449991: single-byte brace expansion handles $'\0' and control character ↵Bart Schaefer1-9/+6
output aligns with multibyte
2022-04-0449955: Src/glob.c: fix bad free in incremental-pattern-search matchingBart Schaefer1-3/+10
2022-03-3049870: Fix NULL reference in match code moreMikael Magnusson1-2/+6
This reverts "49658: Fix NULL reference in match code." and adds a check inside the block, as well as a failsafe check at the end. The above commit (49658) causes a crash due to ll being calculated as 0 which leads to rr being an invalid pointer. Only adding a check for when ll is 0 just leads to bck-i-search pattern not working at all (the final hunk). Restoring the condition and adding an explicit NULL check for replstr seems to make matters work as intended.
2021-12-2149658: Fix NULL reference in match code.Peter Stephenson1-1/+1
A test when acquiring the replacement pattern match in the globbing code erroneously allowed the use of a NULL pointer. This appears to be an unnecessary test case added alongside other surgery back in 2008.
2020-01-1545291: A glob with a trailing slash will now match unreadable/unexecutable ↵Daniel Shahaf1-10/+39
directories.
2020-01-0245181: Fix workers/45164: ${(S)%%} will now consider the empty string as a ↵Daniel Shahaf1-2/+2
potential match.
2019-12-1245001: Fix zero-length matches with ${...%...}Peter Stephenson1-0/+6
As the shortest match is preferred, zero-length matches beat any other.
2019-12-1145004: Fix typos in commentsMartijn Dekker1-2/+2
2019-06-2044435: Handling digita arguments for :h and :t.Peter Stephenson1-1/+1
Pick number of leading or trailing path components to substitute. Active in history, brace parameters, glob qualifiers. Add tests for all three environments.
2018-06-2543091: In the (u) glob qualifier, expand and correct "unknown user" error ↵Daniel Shahaf1-2/+4
messages.
2017-11-20stat() for glob qualifiers lost information in corner caseDima Kogan1-1/+1
2017-07-1341420: "{.." wasn't check for brace expansion properlyPeter Stephenson1-0/+2
2017-03-2340891: fix more zero-length matches.Peter Stephenson1-1/+3
This time at the end of the trial string.
2017-03-2322601: Fix for parameter substitution pattern matches.Peter Stephenson1-2/+6
It was not possible to math against a zero-length string in some cases.
2017-03-1040819: Fix IS_DASH test in BRACE_CCL handlingPeter Stephenson1-1/+2
2017-03-0740760: Always tokenize unquoted - to Dash.Peter Stephenson1-10/+13
This fixes use of pattern match character ranges in unusual contexts. Attempt to detect a tokenized - in cases where we don't care.
2017-01-2940453: signal handler safety for callers of patcompile(PAT_STATIC), which is ↵Barton E. Schaefer1-5/+12
not re-entrant.
2016-11-2940035: Cosmetic fixes for comments and documentation.Eitan Adler1-1/+1
Mostly fixes to doubled words.
2016-11-1739958: Add extra byte to PATH_MAX allocations.Peter Stephenson1-2/+2
This ensures we've got enough space for a null, although this isn't always needed.
2016-10-2539723: metafy string passed to pattern in complist.Peter Stephenson1-0/+4
Also additional safety tokenizing a string with Meta characters.
2016-07-28users/21793: Remove raw integers as glob qualifiers.Peter Stephenson1-8/+1
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-2038853: use strchr()Peter Stephenson1-7/+1
2016-07-1838879: Unmetafy file names for glob sort.Peter Stephenson1-1/+29
Test using Polish UTF-8 collation sequence that'w known to cause the problems.
2016-02-0337868: add 'static' to file local variablesJun-ichi Takimoto1-1/+1
2016-01-1937693: turn Dash into '-' in glob qualifiersPeter Stephenson1-1/+4
2016-01-1937689: ! and ^ need to be tokenised in character setsPeter Stephenson1-15/+4
2016-01-1937678: Now possible to quote "-" in pattern rangePeter Stephenson1-3/+19
2016-01-0137483: save and possibly restore cshnullglob failure state around each ↵Barton E. Schaefer1-1/+4
evaluation of an (e:...:) glob qualifier.
2015-11-1137092: make nested ${(P)name} properly refer to parameter on returnPeter Stephenson1-1/+1
2015-10-3037022: add GLOB_STAR_SHORT option to abbreviate ** and ***Peter Stephenson1-18/+25
2015-09-3036711: Allocate unmetafied pattern trial string on the heapPeter Stephenson1-25/+0
2015-09-29unposted: fix typo in comment.Barton E. Schaefer1-1/+1
2015-09-2936700: unmetafy early for parameter matchPeter Stephenson1-181/+255
2015-09-2836682: expand pattern interface to optimise unmetaficationPeter Stephenson1-25/+31
2015-09-2436603: glob: fix dirfd leak during Y shortcut qualifierMikael Magnusson1-1/+3
2015-09-1236491: Multibyte support for parameter expansion flags B,E,NJun-ichi Takimoto1-3/+3
2015-08-2136264: glob and pattern variable pathbuf is metafied.Peter Stephenson1-4/+10
Document this and unmetafy it when passing to system calls, including lchdir() which is a system-level interface.
2015-08-1036084: use zrealloc() consistentlyBarton E. Schaefer1-1/+1
2015-08-0936033: a few more queue_signals() to protect global state changesBarton E. Schaefer1-0/+4
2015-06-12Add non-metafied character length handling.Peter Stephenson1-7/+7
Use this in regex module and add test using $'\ua0'. Rename mb_metacharinit() to mb_charinit() as it does not involve metafied characters.
2015-04-2534965: consistent use of zalloc/zrealloc/zfreeBarton E. Schaefer1-3/+3
2015-04-0334837: avoid loss of original file path when applying colon-modifiers in ↵Barton E. Schaefer1-2/+2
glob qualifiers
2015-02-2734634: avoid infinite recursion on (/)# extendedglobBarton E. Schaefer1-1/+2
2014-12-1133876: etc.: Separate errors and keyboards interruptsPeter Stephenson1-5/+7
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-0733854: errors end recursion through scanner()Barton E. Schaefer1-1/+1
Makes **/ more easily interruptible