| 129 | } |
| 130 | |
| 131 | std::string PathSearcher::joinPaths(const std::string &first, const std::string &second) |
| 132 | { |
| 133 | // Start with first string. |
| 134 | std::string result = first; |
| 135 | |
| 136 | // Add path separator if needed |
| 137 | if ((first[first.size() - 1] != PATH_SEP_CHAR) && (second[0] != PATH_SEP_CHAR)) |
| 138 | { |
| 139 | result += PATH_SEP_STRING; |
| 140 | } |
| 141 | |
| 142 | // Append the second string. |
| 143 | result += second; |
| 144 | |
| 145 | // And return the whole mess. |
| 146 | return result; |
| 147 | } |