* Herbert Xu: > On Thu, Dec 10, 2020 at 08:58:37AM +0100, Aurelien Jarno wrote: >> >> That's the dash symptoms. glob(3) takes a pattern and just returns the >> paths matching the pattern, as they are named on the filesystem. That >> said, the option GLOB_MARK can return a trailing slash for all matched >> path that are a directory. > > Yes but it's really a bug in glob(3). It should really return > a no-match for the case in question, rather than matching and then > returning a filename without the slash. > > IOW the pattern "foo\/" should not match a regular file foo. I believe this has been reported upstream here: <https://sourceware.org/bugzilla/show_bug.cgi?id=25659> (But I have not reveiwed this particular bug thread here, sorry.)