|
From: | Paul Eggert |
Subject: | Re: [PATCH] posix: if glob has a trailing slash match directories only. |
Date: | Mon, 4 Dec 2017 00:01:04 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
Dmitry Goncharov wrote:
flags |= GLOB_ONLYDIR | GLOB_MARK; and then at the end, filter out all matches that aren't marked with trailing '/'. This would avoid creating a new GLOB_XXX option and would probably be easier to implement.Please have a look at this implementation of your idea.
I'm not quite following how it's an implementation, since I don't see where it does anything like "flags |= GLOB_ONLYDIR | GLOB_MARK;". Maybe there's another part of the patch you're missing?
The variable "filter" is a boolean and should be of type bool.That comment and code look over-complicated. Can't you simply copy nonnull entries in-place, in a single pass? That way, the filtered order will be the same as the original order.
[Prev in Thread] | Current Thread | [Next in Thread] |