Browse Source

fix rename'ing to local device

pull/30/head
Antonio SJ Musumeci 11 years ago
parent
commit
ec38a9c783
  1. 10
      src/fs.cpp
  2. 2
      src/rename.cpp

10
src/fs.cpp

@ -136,12 +136,12 @@ namespace fs
string
make_path(const string base,
const string fusepath)
const string suffix)
{
if(*base.rbegin() == '/' ||
*fusepath.rbegin() == '/')
return base + fusepath;
return base + '/' + fusepath;
if(suffix[0] == '/' ||
*base.rbegin() == '/')
return base + suffix;
return base + '/' + suffix;
}
bool

2
src/rename.cpp

@ -57,6 +57,8 @@ _rename(const fs::SearchFunc searchFunc,
pathto = fs::make_path(pathfrom[0].base,to);
rv = ::rename(pathfrom[0].full.c_str(),pathto.c_str());
if(rv == -1 && errno == ENOENT)
return -EXDEV;
return ((rv == -1) ? -errno : 0);
}

Loading…
Cancel
Save