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

Function fts_load

util/folder/fts.cpp:381–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381static void
382fts_load(FTS* sp, FTSENT* p)
383{
384 size_t len;
385 char* cp;
386
387 /*
388 * Load the stream structure for the next traversal. Since we don't
389 * actually enter the directory until after the preorder visit, set
390 * the fts_accpath field specially so the chdir gets done to the right
391 * place and the user can access the first node. From yfts_open it's
392 * known that the path will fit.
393 */
394 len = p->fts_pathlen = p->fts_namelen;
395 memmove((void*)sp->fts_path, (void*)p->fts_name, len + 1);
396 if ((cp = strrchr(p->fts_name, LOCSLASH_C)) != nullptr && (cp != p->fts_name || cp[1])) {
397 len = strlen(++cp);
398 memmove((void*)p->fts_name, (void*)cp, len + 1);
399 p->fts_namelen = (u_short)len;
400 }
401 p->fts_accpath = p->fts_path = sp->fts_path;
402 sp->fts_dev = p->fts_dev;
403}
404
405int yfts_close(FTS* sp)
406{

Callers 1

yfts_readFunction · 0.85

Calls 2

memmoveFunction · 0.85
strrchrFunction · 0.50

Tested by

no test coverage detected