much be exchanged. */
#if 0
static /* avoid warning */
-#endif
+#endif
string
slashify (string file_name)
{
s = s.substr (0, s.rfind ('/'));
else
s = "";
-
+
return s;
}
return s;
}
-
string
File_name::file_part () const
{
string f = file_part ();
if (!f.empty ()
- && !dir_.empty())
+ && !dir_.empty ())
{
d += ::to_string (DIRSEP);
}
File_name::is_absolute () const
{
/*
- Hmm. Is c:foo absolute?
+ Hmm. Is c:foo absolute?
*/
return (dir_.length () && dir_[0] == DIRSEP) || root_.length ();
}
-
-
File_name
File_name::canonicalized () const
{
replace_all (&c.dir_, string ("//"), string ("/"));
- vector<string> components = string_split (c.dir_, '/');
+ vector<string> components = string_split (c.dir_, '/');
vector<string> new_components;
for (vsize i = 0; i < components.size (); i++)
{
if (components[i] == "..")
- new_components.pop_back ();
+ new_components.pop_back ();
else
- new_components.push_back (components[i]);
+ new_components.push_back (components[i]);
}
- c.dir_ = string_join (new_components, "/");
- return c;
+ c.dir_ = string_join (new_components, "/");
+ return c;
}