":" path is "." in unix

This commit is contained in:
Kelvin Sherlock 2015-01-05 12:32:34 -05:00
parent 6449892f51
commit 183078925e

View File

@ -42,10 +42,10 @@ namespace {
* file -> file * file -> file
* :directory:file -> directory/file * :directory:file -> directory/file
* volume:directory -> /volume/directory * volume:directory -> /volume/directory
* : -> ./
* :: -> ../ * :: -> ../
* ::: -> ../../ * ::: -> ../../
* *
*
* To Unix: * To Unix:
* file -> file * file -> file
* directory/file -> :directory:file * directory/file -> :directory:file
@ -77,6 +77,12 @@ namespace {
}; };
':' { ':' {
/*
if (ts == begin)
rv.append("./");
else
rv.push_back('/');
*/
if (ts != begin) if (ts != begin)
rv.push_back('/'); rv.push_back('/');
}; };
@ -151,6 +157,8 @@ namespace ToolBox
// no colon - no problem. // no colon - no problem.
if (!colon) return path; if (!colon) return path;
// special case ":" -> "."
if (colon && path.length() == 1) return ".";
const char *p = path.c_str(); const char *p = path.c_str();
const char *pe = p + path.length(); const char *pe = p + path.length();