*/
#include <msp/strutils.h>
#include "path.h"
+#include "utils.h"
using namespace std;
-#include <iostream>
namespace Msp {
namespace Path {
path(p),
start(0)
{
- if(path.path[0]==DIRCHAR)
+ if(path.path.empty())
+ start=end=string::npos;
+ else if(path.path[0]==DIRCHAR)
end=1;
#ifdef WIN32
- else if(path.path[2]==DIRCHAR && is_windows_drive(path.path.substr(0,2)))
+ else if(path.path.size()>2 && path.path[2]==DIRCHAR && is_windows_drive(path.path.substr(0,2)))
end=2;
#endif
else