----------------------------------------------------------------------------------
@MSGID: <20230912101332.94@kylheku.com> 4e026aee
@REPLY: <20230911234401.851@kylheku.com> 32d1c8e9
@REPLYADDR Kaz Kylheku <864-117-4973@kylheku.com>
@REPLYTO 2:5075/128 Kaz Kylheku
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: <20230912101332.94@kylheku.com>
@RFC-References: <20230911202309.171@kylheku.com>
<20230911234401.851@kylheku.com>
@TZUTC: -0000
@PID: slrn/pre1.0.4-9 (Linux)
@TID: FIDOGATE-5.12-ge4e8b94
On 2023-09-12, Kaz Kylheku <
864-117-4973@kylheku.com> wrote:
> On 2023-09-12, Kaz Kylheku <
864-117-4973@kylheku.com> wrote:
>> The real function should handle patterns starting with "**/" and also
>> ending in "/**", as well as when "**" is the entire pattern.
>
> I fixed this in the prototype.
Issues:
1. Sorting with brace expansions:
Brace expansion, is supported in glibc`s glob via GLOB_BRACE.
The order of the brace substitutions has to be preserved
through the globbing.
Given a glob pattern "alpha{beta,gamma}omega", it has to be
expanded into "alphabetaomega" and "alphagammaomega" which
are separately matched, sorted, and then combined together in
that order.
It has to be that way, otherwise it will wreck the semantics of
command lines generated with brace expansion.
E.g. *.{foo,bar} has to behave like *.foo *.bar where all the
.foo files list before .bar files.
That means if you want to implement some new glob semantics on top
of glob, you have to intercept GLOB_BRACE and do it yourself;
you can`t just apply a sorting pass to the total expansion.
2. Escaping
The interior /**/ pattern could occur in a class like [abc/**/def]
in which case it must not be recognized.
--- slrn/pre1.0.4-9 (Linux)
* Origin: A noiseless patient Spider (2:5075/128)
SEEN-BY: 5001/100 5005/49 5010/352 5015/255 5019/40
5020/715 848 1042 4441
SEEN-BY: 5020/12000 5030/49 1081 5075/128
@PATH: 5075/128 5020/1042 4441