View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014193CMakeCMakepublic2013-06-04 01:542013-11-04 09:33
ReporterYichao Yu 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformLinuxOSArch LinuxOS Version
Product VersionCMake 2.8.11 
Target VersionFixed in Version 
Summary0014193: get_filename_component(ABSOLUTE) doesn't remove multiple leading /
DescriptionWhen given a path with multiple leading /'s, get_filename_component returns a filename with two leading /'s.
Although this behavior is consistent with how cd set PWD (see 8.c of cd(1)[1]), it doesn't consistent with realpath(1) and realpath(3). And it also makes it harder to use this absolute path as an unique identifier of the file directly. Non-posix shell like zsh(1) also removes multiple leading /'s in PWD and I personally don't see any advantage of not removing them.

The same thing applies to get_filename_component(REALPATH) when a not-yet-exists path is given. (probably related to 0014192.)

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cd.html [^]
Steps To Reproduceget_filename_component(abs_path "//lib" ABSOLUTE)
message("${abs_path}")

expected output:
/lib

actual output:
//lib
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0033222)
Brad King (manager)
2013-06-04 08:08

Two leading slashes is a valid *network* path prefix: //machine/share/... so they cannot be stripped.
(0034360)
Robert Maynard (manager)
2013-11-04 09:33

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-06-04 01:54 Yichao Yu New Issue
2013-06-04 08:08 Brad King Note Added: 0033222
2013-06-04 08:08 Brad King Status new => resolved
2013-06-04 08:08 Brad King Resolution open => won't fix
2013-11-04 09:33 Robert Maynard Note Added: 0034360
2013-11-04 09:33 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team