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.
Aurelien Jarno <aurelien@aurel32.net> wrote:
Can you please describe more precisely what is the problem with glob(3)?
It's stripping trailing slashes from the pattern, even when the
name in question is a regular file.
https://patchwork.kernel.org/project/dash/patch/20201116025222.GA28742@gondor.apana.org.au/
Can you please describe more precisely what is the problem with glob(3)?
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.
Note that the problem doesn't occur for "foo/".
Can you please describe more precisely what is the problem with glob(3)?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 223:07:29 |
Calls: | 6,623 |
Calls today: | 5 |
Files: | 12,171 |
Messages: | 5,318,354 |