| 44 | static const char *executable_dirname; |
| 45 | |
| 46 | static 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. |
no test coverage detected