View Issue Details

IDProjectCategoryView StatusLast Update
00013011003.1(2016/18)/Issue7+TC2System Interfacespublic2019-12-19 18:04
Reporterdmitry_goncharov Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status ResolvedResolutionAccepted As Marked 
NameDmitry Goncharov
Organization
User Reference
Sectionglob
Page Number1109
Line Number37544-37545
Interp Status---
Final Accepted TextSee 0001300:0004692 in 0001300.
Summary0001301: clarify glob("/", GLOB_MARK, ...) behavior
DescriptionThe current standard says
"GLOB_MARK
Each pathname that is a directory that matches pattern shall have a <slash> appended."

When pattern is a "/", "./", "../", "//", "///", etc a conformant implementation would return "//", ".//", "..//", "///", "////" respectively.
This is hardly useful.

I checked various implementation and they all behave differently.

Given "/" glibc produces "//", sunos produces "//", aix produces "/".
Given "//" glibc produces "//", sunos produces "///", aix returns GLOB_NOMATCH.
Given "///" glibc produces "//", sunos produces "////", aix returns GLOB_NOMATCH.
Given "/tmp/" glibc produces "/tmp/", sunos produces "/tmp//", aix produces "/tmp/".
Given "/tmp//" glibc produces "/tmp/", sunos produces "/tmp///", aix produces "/tmp/".
Given "/tmp///" glibc produces "/tmp/", sunos produces "/tmp////", aix produces "/tmp/".
Desired ActionReplace
"Each pathname that is a directory that matches pattern shall have a <slash> appended."

With
"Each pathname that is a directory that matches pattern shall have a <slash> appended, unless the pathname already has a trailing slash."
TagsNo tags attached.

Relationships

related to 0001300 Closed clarify GLOB_MARK behavior 

Activities

hvd

2019-11-15 22:59

reporter   bugnote:0004659

Bug 1300 and bug 1301 asked two different questions, even if they were both about GLOB_MARK. Bug 1300 asked whether symlinks to directories should be treated the same as directories. Bug 1301 asked whether pathnames that already end in a slash should have another slash appended. I am noting this so that bug 1300's question does not get overlooked now that it has been closed as a duplicate of this one.

Don Cragun

2019-12-19 17:53

manager   bugnote:0004693

This bug and 0001300 were discussed together during the 2019-12-19 conference call. The issues raised by both bugs are fixed in 0001300:0004692.

Issue History

Date Modified Username Field Change
2019-11-15 22:26 dmitry_goncharov New Issue
2019-11-15 22:26 dmitry_goncharov Name => Dmitry Goncharov
2019-11-15 22:26 dmitry_goncharov URL => https://pubs.opengroup.org/onlinepubs/9699919799/
2019-11-15 22:26 dmitry_goncharov Section => glob
2019-11-15 22:36 Don Cragun Relationship added has duplicate 0001300
2019-11-15 22:59 hvd Note Added: 0004659
2019-11-15 23:13 Don Cragun Relationship deleted has duplicate 0001300
2019-11-15 23:16 Don Cragun Relationship added related to 0001300
2019-12-19 17:48 Don Cragun Project Online Pubs => 1003.1(2016/18)/Issue7+TC2
2019-12-19 17:53 Don Cragun Page Number => (page or range of pages)
2019-12-19 17:53 Don Cragun Line Number => (Line or range of lines)
2019-12-19 17:53 Don Cragun Interp Status => ---
2019-12-19 17:53 Don Cragun Final Accepted Text => See 0001300:0004692 in 0001300.
2019-12-19 17:53 Don Cragun Note Added: 0004693
2019-12-19 17:53 Don Cragun Status New => Resolved
2019-12-19 17:53 Don Cragun Resolution Open => Accepted As Marked
2019-12-19 17:53 Don Cragun Tag Attached: issue8
2019-12-19 18:04 Don Cragun Page Number (page or range of pages) => 1109
2019-12-19 18:04 Don Cragun Line Number (Line or range of lines) => 37544-37545
2019-12-19 18:04 Don Cragun Category Base Definitions => System Interfaces
2019-12-20 10:04 Don Cragun Tag Detached: issue8