BeOS 5 also doesn't have realpath(), but its C++ API offers something close.
| 262 | |
| 263 | // BeOS 5 also doesn't have realpath(), but its C++ API offers something close. |
| 264 | static inline char* realpath(char const* path, char* resolved_path) |
| 265 | { |
| 266 | size_t const maxlen = KWSYS_SYSTEMTOOLS_MAXPATH; |
| 267 | snprintf(resolved_path, maxlen, "%s", path); |
| 268 | BPath normalized(resolved_path, nullptr, true); |
| 269 | char const* resolved = normalized.Path(); |
| 270 | if (resolved) // nullptr == No such file. |
| 271 | { |
| 272 | if (snprintf(resolved_path, maxlen, "%s", resolved) < maxlen) { |
| 273 | return resolved_path; |
| 274 | } |
| 275 | } |
| 276 | return nullptr; // something went wrong. |
| 277 | } |
| 278 | #endif |
| 279 | |
| 280 | #ifdef _WIN32 |
no test coverage detected
searching dependent graphs…