MCPcopy Create free account
hub / github.com/catboost/catboost / skip_disk

Function skip_disk

util/folder/dirut.cpp:209–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207// root slash (if any) - part of disk
208template <typename T>
209static 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
236int correctpath(char* cpath, const char* path) {
237 if (!path || !*path) {

Callers 2

correctpathFunction · 0.85
resolvepathFunction · 0.85

Calls 1

next_dirFunction · 0.85

Tested by

no test coverage detected