MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / expand_tilde

Function expand_tilde

utility/glob.cpp:409–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409String expand_tilde(String path) {
410 if (path.is_empty() || path[0] != '~') {
411 return path;
412 }
413
414 String home = get_user_home_dir();
415
416 if (path.size() > 1) {
417 return home + path.substr(1, path.size() - 1);
418 } else {
419 return home;
420 }
421}
422} //namespace
423
424Ref<RegEx> Glob::escapere = nullptr;

Callers 1

_globMethod · 0.85

Calls 2

get_user_home_dirFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected