| 107 | } |
| 108 | |
| 109 | void PathUtils::splitLastComponent(PathName& path, PathName& file, |
| 110 | const PathName& orgPath) |
| 111 | { |
| 112 | PathName::size_type pos = orgPath.rfind(PathUtils::dir_sep); |
| 113 | if (pos == PathName::npos) |
| 114 | { |
| 115 | pos = orgPath.rfind('/'); // temp hack to make it work with paths, |
| 116 | // not expanded by ISC_expand_filename |
| 117 | if (pos == PathName::npos) |
| 118 | { |
| 119 | path = ""; |
| 120 | file = orgPath; |
| 121 | return; |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | path.erase(); |
| 126 | path.append(orgPath, 0, pos); // skip the directory separator |
| 127 | file.erase(); |
| 128 | file.append(orgPath, pos + 1, orgPath.length() - pos - 1); |
| 129 | } |
| 130 | |
| 131 | void PathUtils::concatPath(PathName& result, |
| 132 | const PathName& first, |