| 207 | // root slash (if any) - part of disk |
| 208 | template <typename T> |
| 209 | static int skip_disk(T*& ptr) { |
| 210 | int result = dk_noflags; |
| 211 | if (!*ptr) { |
| 212 | return result; |
| 213 | } |
| 214 | if (ptr[0] == '\\' && ptr[1] == '\\') { |
| 215 | result |= dk_unc | dk_fromroot; |
| 216 | ptr += 2; |
| 217 | if (next_dir(ptr) != dt_dir) { |
| 218 | return dk_error; // has no host name |
| 219 | } |
| 220 | if (next_dir(ptr) != dt_dir) { |
| 221 | return dk_error; // has no share name |
| 222 | } |
| 223 | } else { |
| 224 | if (*ptr && *(ptr + 1) == ':') { |
| 225 | result |= dk_hasdrive; |
| 226 | ptr += 2; |
| 227 | } |
| 228 | if (*ptr == '\\' || *ptr == '/') { |
| 229 | ++ptr; |
| 230 | result |= dk_fromroot; |
| 231 | } |
| 232 | } |
| 233 | return result; |
| 234 | } |
| 235 | |
| 236 | int correctpath(char* cpath, const char* path) { |
| 237 | if (!path || !*path) { |
no test coverage detected