Austin Group Defect Tracker

Aardvark Mark III


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001301 [Online Pubs] Base Definitions Editorial Clarification Requested 2019-11-15 22:26 2019-11-15 23:16
Reporter dmitry_goncharov View Status public  
Assigned To
Priority normal Resolution Open  
Status New  
Name Dmitry Goncharov
Organization
User Reference
URL https://pubs.opengroup.org/onlinepubs/9699919799/ [^]
Section glob
Summary 0001301: clarify glob("/", GLOB_MARK, ...) behavior
Description The 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 Action Replace
"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."
Tags No tags attached.
Attached Files

- Relationships
related to 0001300New clarify GLOB_MARK behavior 

-  Notes
(0004659)
hvd (reporter)
2019-11-15 22:59

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.

- 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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker