| 497 | //--------------------------------------------------------------------------- |
| 498 | |
| 499 | std::string stripTrailingSlash(std::string strPath) |
| 500 | { |
| 501 | #ifdef WIN32 |
| 502 | char lastchar = strPath[strPath.size()-1]; |
| 503 | if (lastchar == '\\' || lastchar == '/') |
| 504 | { |
| 505 | strPath = strPath.substr(0, strPath.size() - 1); |
| 506 | } |
| 507 | else |
| 508 | { |
| 509 | std::string x = strPath.substr(strPath.size() - 2, 2); |
| 510 | if (x == "\\." || lastchar == '/.') |
| 511 | { |
| 512 | strPath = strPath.substr(0, strPath.size() - 2); |
| 513 | } |
| 514 | } |
| 515 | #else |
| 516 | char lastchar = strPath[strPath.size()-1]; |
| 517 | if (lastchar == '/') |
| 518 | { |
| 519 | strPath = strPath.substr(0, strPath.size() - 1); |
| 520 | } |
| 521 | else |
| 522 | { |
| 523 | std::string x = strPath.substr(strPath.size() - 2, 2); |
| 524 | if (x == "/.") |
| 525 | { |
| 526 | strPath = strPath.substr(0, strPath.size() - 2); |
| 527 | } |
| 528 | } |
| 529 | #endif |
| 530 | return strPath; |
| 531 | } |
| 532 | |
| 533 | std::string completePath(const std::string &spath, const std::string &base) |
| 534 | { |
no test coverage detected