MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / sh_absolute

Function sh_absolute

src/pipeline/pass_shell.c:773–784  ·  view source on GitHub ↗

realpath / readlink -f: the anchored path, when it is decidable. */

Source from the content-addressed store, hash-verified

771
772/* realpath / readlink -f: the anchored path, when it is decidable. */
773static const char *sh_absolute(sh_t *s, const char *v) {
774 if (!v) {
775 return NULL;
776 }
777 if (v[0] == SH_ANCHOR) {
778 return sh_anchor(s->a, sh_join(s->a, "", v + SKIP_ONE));
779 }
780 if (v[0] == '/' || s->cwd.mode != SH_AT) {
781 return NULL;
782 }
783 return sh_anchor(s->a, sh_join(s->a, s->cwd.dir, v));
784}
785
786typedef struct {
787 const char **v;

Callers 1

sh_eval_subst_commandFunction · 0.85

Calls 2

sh_anchorFunction · 0.85
sh_joinFunction · 0.85

Tested by

no test coverage detected