mirror of
https://github.com/git/git.git
synced 2026-01-31 21:09:39 +00:00
Avoid multiple PREFIX definitions
The short and sweet PREFIX can be confused when used in many places. Rename both usages to better describe their purpose. EXEC_CMD_PREFIX is used in full to disambiguate it from the nearby GIT_EXEC_PATH. The PREFIX in sideband.c, while nominally independant of the exec_cmd PREFIX, does reside within libgit[1], so the definitions would clash when taken together with a PREFIX given on the command line for use by exec_cmd.c. Noticed when compiling Git for Windows using MSVC/Visual Studio [1] which reports the conflict beteeen the command line definition and the definition in sideband.c within the libgit project. [1] the libgit functions are brought into a single sub-project within the Visual Studio construction script provided in contrib, and hence uses a single command for both exec_cmd.c and sideband.c. Signed-off-by: Philip Oakley <philipoakley@iee.org>
This commit is contained in:
committed by
Johannes Schindelin
parent
bed663109b
commit
ba4397be37
@@ -12,7 +12,7 @@ char *system_path(const char *path)
|
||||
#ifdef RUNTIME_PREFIX
|
||||
static const char *prefix;
|
||||
#else
|
||||
static const char *prefix = PREFIX;
|
||||
static const char *prefix = FALLBACK_RUNTIME_PREFIX;
|
||||
#endif
|
||||
struct strbuf d = STRBUF_INIT;
|
||||
|
||||
@@ -27,7 +27,7 @@ char *system_path(const char *path)
|
||||
!(prefix = strip_path_suffix(argv0_path, GIT_EXEC_PATH)) &&
|
||||
!(prefix = strip_path_suffix(argv0_path, BINDIR)) &&
|
||||
!(prefix = strip_path_suffix(argv0_path, "git"))) {
|
||||
prefix = PREFIX;
|
||||
prefix = FALLBACK_RUNTIME_PREFIX;
|
||||
trace_printf("RUNTIME_PREFIX requested, "
|
||||
"but prefix computation failed. "
|
||||
"Using static fallback '%s'.\n", prefix);
|
||||
|
||||
Reference in New Issue
Block a user