MCPcopy Index your code
hub / github.com/git/git / system_prefix

Function system_prefix

exec-cmd.c:46–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44static const char *executable_dirname;
45
46static const char *system_prefix(void)
47{
48 static const char *prefix;
49
50 assert(executable_dirname);
51 assert(is_absolute_path(executable_dirname));
52
53 if (!prefix &&
54 !(prefix = strip_path_suffix(executable_dirname, GIT_EXEC_PATH)) &&
55 !(prefix = strip_path_suffix(executable_dirname, BINDIR)) &&
56 !(prefix = strip_path_suffix(executable_dirname, "git"))) {
57 prefix = FALLBACK_RUNTIME_PREFIX;
58 trace_printf("RUNTIME_PREFIX requested, "
59 "but prefix computation failed. "
60 "Using static fallback '%s'.\n", prefix);
61 }
62 return prefix;
63}
64
65/*
66 * Resolves the executable path from argv[0], only if it is absolute.

Callers 1

system_pathFunction · 0.85

Calls 2

is_absolute_pathFunction · 0.85
strip_path_suffixFunction · 0.85

Tested by

no test coverage detected