MantisBT - CMake |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0014186 | CMake | CMake | public | 2013-06-02 01:54 | 2013-11-04 09:33 |
|
Reporter | Yichao Yu | |
Assigned To | Brad King | |
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | Linux | OS | Archlinux | OS Version | |
Product Version | CMake 2.8.11 | |
Target Version | CMake 2.8.12 | Fixed in Version | CMake 2.8.12 | |
|
Summary | 0014186: get_filename_component(ABSOLUTE) return wrong value for parent dir of / |
Description | On unix-like system the parent directory of / should be / itself. However, get_filename_component return empty string for that case.
|
Steps To Reproduce | In (sh-compatible) command line, type:
cmake -DINPUT='/../lib' -P /dev/stdin <<EOF
get_filename_component(abspath "\${INPUT}" ABSOLUTE)
message("\${abspath}")
EOF
expected output /lib
actual output lib (which is not an absolute path at all !!)
|
Additional Information | |
Tags | No tags attached. |
Relationships | |
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2013-06-02 01:54 | Yichao Yu | New Issue | |
2013-06-03 09:08 | Brad King | Note Added: 0033195 | |
2013-06-03 09:08 | Brad King | Assigned To | => Brad King |
2013-06-03 09:08 | Brad King | Status | new => assigned |
2013-06-03 09:08 | Brad King | Target Version | => CMake 2.8.12 |
2013-06-03 09:09 | Brad King | Note Edited: 0033195 | bug_revision_view_page.php?bugnote_id=33195#r1170 |
2013-06-03 09:55 | Yichao Yu | Note Added: 0033199 | |
2013-06-03 23:56 | Yichao Yu | Note Edited: 0033199 | bug_revision_view_page.php?bugnote_id=33199#r1178 |
2013-06-03 23:56 | Yichao Yu | Note Edited: 0033199 | bug_revision_view_page.php?bugnote_id=33199#r1179 |
2013-06-04 09:17 | Brad King | Note Added: 0033228 | |
2013-06-04 09:18 | Brad King | Status | assigned => resolved |
2013-06-04 09:18 | Brad King | Resolution | open => fixed |
2013-06-04 09:18 | Brad King | Fixed in Version | => CMake 2.8.12 |
2013-11-04 09:33 | Robert Maynard | Note Added: 0034362 | |
2013-11-04 09:33 | Robert Maynard | Status | resolved => closed |
Notes |
|
(0033195)
|
Brad King
|
2013-06-03 09:08
(edited on: 2013-06-03 09:09) |
|
Try this patch:
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 158217e..ce4dfc8 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -3049,7 +3049,7 @@ SystemToolsAppendComponents(
{
if(*i == "..")
{
- if(out_components.begin() != out_components.end())
+ if(out_components.size() > 1)
{
out_components.erase(out_components.end()-1, out_components.end());
}
|
|
|
(0033199)
|
Yichao Yu
|
2013-06-03 09:55
(edited on: 2013-06-03 23:56) |
|
yep, that works. (although there are some white space problems in the patch pasted....)
|
|
|
(0033228)
|
Brad King
|
2013-06-04 09:17
|
|
|
|
(0034362)
|
Robert Maynard
|
2013-11-04 09:33
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|