---------------------------------------------------------------------------
| 791 | |
| 792 | //--------------------------------------------------------------------------- |
| 793 | void changePath(std::string &name, const std::string &newpath) |
| 794 | { |
| 795 | if (!newpath.empty()) |
| 796 | { |
| 797 | std::string spath = fs::path(newpath).string(); |
| 798 | // if ((!isRoot(spath)) && (extractFileName(name) != "")) |
| 799 | // spath += dirsep; |
| 800 | if (extractFileName(name) != "") |
| 801 | name = spath + ((spath[spath.length()-1] == dirsep[0]) ? std::string("") : dirsep) + extractFileName(name); |
| 802 | else |
| 803 | { |
| 804 | name = spath; |
| 805 | if (!isRoot(name)) |
| 806 | name = stripTrailingSlash(spath); |
| 807 | } |
| 808 | } |
| 809 | else |
| 810 | // ???? Is this the behaviour we want ? |
| 811 | name = extractFileName(name); |
| 812 | } |
| 813 | |
| 814 | |
| 815 | //--------------------------------------------------------------------------- |
no test coverage detected