• R/O
  • SSH

yash: List of commits

修訂. 時間 作者
r4095 2020-10-04 22:45:09 magicant

The expand_single_cc function

r4094 2020-10-04 16:10:49 magicant

Don't read after terminating null in expand_four

This bug was introduced in c4046.

r4093 2020-09-29 00:21:00 magicant

Allow expanding "$@""$@" to nothing (#40719)

When there are no positional parameters, "$@" should expand to zero
fields. Two times zero fields should be zero fields.

This commit modifies many parts of word expansion algorithm. The most
important change is in the way the double-quotes are removed after the
expansion of $@. In the previous implementation, the double-quotes were
removed in empty field removal, which is done after field splitting.
That behavior more closely resembled the order of expansion steps as
defined in POSIX, but it removed only one pair of double-quotes.

To remove correct number of double-quotes, we now remove them in the
expand_four function, just when expand_param returns zero fields.

To count the number of expanded fields returned from expand_param in
expand_four, expand_param now needs to return the expanded fields
directly. In doing so, the expand_four_T structure is simplified, the
expand_four_inner_T structure is removed, and the expand_four and
expand_param functions return expand_four_T as a return value instead of
an output parameter.

r4092 2020-09-29 00:20:59 magicant

More tests on expansion of $* and $@

r4091 2020-09-29 00:20:58 magicant

Abort immediately on expansion error

Many other shells behave this way.

r4090 2020-09-26 23:19:33 magicant

Use pl_truncate instead of pl_clear where possible

pl_truncate is an inline function. It should be faster.

r4089 2020-09-26 16:59:59 magicant

Faster field splitting

- Merge the `fieldsplit_all' and `fieldsplit` functions so that the
`fields' list is not allocated for each input string.
- Directly add the input string to the result list if the result string
is the same as the input.

r4088 2020-09-26 16:59:58 magicant

Amend: Faster brace expansion (#40708)

- Documentation for the `try_expand_brace_sequence' function
- Memory leak in the `try_expand_brace_sequence' function

r4087 2020-09-26 12:23:47 magicant

Faster brace expansion (#40708)

Previously, the time complexity of the brace expansion algorithm for an
input string of the form "{{{{{{...{{{" was O(n^2) where n is the length
of the input string. It was because, for each '{', the algorithm tries
to search all the remaining characters for a matching '}'.

In the new algorithm, we first scan the entire input string in O(n) time
and then generates the final results using the scan result. It should
work faster in case the expansion results in the same string as the

r4086 2020-09-26 12:23:47 magicant

The pl_truncate function

The pl_remove function is not so fast because it internally uses
memmove. Removing last elements can be done more quickly.

r4085 2020-09-26 12:23:46 magicant

More test on complex brace expansion

r4084 2020-09-24 22:12:40 magicant

Cleanup: Remove defaultcc from expand_four

The parameter is always CC_LITERAL, so the value can be hard-coded.

r4083 2020-09-24 21:50:15 magicant

Quoting inside parameter expansion inside double-quotes (#40751)

r4082 2020-09-24 21:50:13 magicant

More tests on quoting in expansions

r4081 2020-09-24 14:18:23 magicant

Correct quote removal in arithmetic expansion (#40738)

r4080 2020-09-21 12:29:05 magicant

Extract common code from print_scalar & print_array

r4079 2020-09-20 22:08:59 magicant

Less memory allocation

r4078 2020-09-20 21:50:30 magicant

wglob: Remove duplicates in linear time complexity

The previous algorithm had square time complexity

r4077 2020-09-20 21:50:30 magicant

Test extended glob **/**

r4076 2020-09-20 16:19:41 magicant

sb_initwithmax and wb_initwithmax

r4075 2020-09-20 16:19:40 magicant


r4074 2020-09-20 12:52:05 magicant

Delete branch charcategory

r4073 2020-09-20 12:51:34 magicant

Merge branch charcategory (#39288)


r4072 2020-09-20 12:16:30 magicant

Treat special backslashes in non-pathname patterns (#39288)

r4071 2020-09-20 12:16:29 magicant

The remove_empty_fields_and_quotes function

This commit extracts the common part from the expand_multiple and
expand_word functions.

r4070 2020-09-20 12:16:28 magicant

The new expand_four function

The beginning part of the expand_multiple and expand_word functions are
the same. This commit extracts the common part as the new expand_four
function and the former expand_four function is renamed to

The expand_four_T structure is also restructured to match the behavior
of the new functions.

r4069 2020-09-20 12:16:27 magicant

Rename expand_4444 and expand_111111 to original names

r4068 2020-09-20 12:16:27 magicant

Remove unused functions

r4067 2020-09-20 12:16:26 magicant

Simplify field splitting

The `escaped' parameter is removed from the `extract_fields' function
because the parameter is now always false.

The skip_... functions are removed in favor of the new is_... functions.

r4066 2020-09-20 12:16:25 magicant

Call expand_4444 in expand_multiple

Show on old repository browser