fix relative logic

This commit is contained in:
Glenn Maynard
2005-05-31 21:27:55 +00:00
parent e7eeb6d89f
commit 2c348ed129
@@ -233,10 +233,13 @@ DirectFilenameDB::DirectFilenameDB( CString root_ )
void DirectFilenameDB::SetRoot( CString root_ )
{
root = root_;
if( root.Right(1) != "/" )
root += '/';
if( root == "./" )
root = "";
/* "\abcd\" -> "/abcd/": */
root.Replace( "\\", "/" );
/* "/abcd/" -> "/abcd": */
if( root.Right(1) == "/" )
root.erase( root.size()-1, 1 );
}