mirror of
https://github.com/git/git.git
synced 2026-03-13 10:23:30 +01:00
remove git_install_prefix()
git_install_prefix() is no longer needed. Relocatable paths are searched relative to git_exec_dir(). This commit removes git_install_prefix(). Signed-off-by: Steffen Prohaska <prohaska@zib.de>
This commit is contained in:
1
cache.h
1
cache.h
@@ -391,7 +391,6 @@ static inline int is_dev_null(const char *str)
|
||||
const char *make_absolute_path(const char *path);
|
||||
/* Convert slashes in place. On Windows to backslashes. */
|
||||
char *make_native_separator(char *path);
|
||||
const char *git_install_prefix();
|
||||
|
||||
/* Read and unpack a sha1 file into memory, write memory to a sha1 file */
|
||||
extern int sha1_object_info(const unsigned char *, unsigned long *);
|
||||
|
||||
35
path.c
35
path.c
@@ -359,41 +359,6 @@ const char *make_absolute_path(const char *path)
|
||||
return buf;
|
||||
}
|
||||
|
||||
const char* git_install_prefix()
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
static char* prefix;
|
||||
|
||||
if (prefix) {
|
||||
return prefix;
|
||||
}
|
||||
|
||||
char* p;
|
||||
int pgm_len = strlen(_pgmptr);
|
||||
prefix = xmalloc(pgm_len + 1);
|
||||
strcpy(prefix, _pgmptr);
|
||||
p = strrchr(prefix, '\\'); /* <gitroot>\bin\ <- p */
|
||||
if (p) {
|
||||
*p = '\0';
|
||||
p = strrchr(prefix, '\\'); /* <gitroot>\ <- p */
|
||||
if (p) {
|
||||
*p = '\0';
|
||||
for (p = prefix; *p; p++)
|
||||
if (*p == '\\')
|
||||
*p = '/';
|
||||
return prefix;
|
||||
}
|
||||
}
|
||||
|
||||
/* Note, according to the msdn documentation we have a full path
|
||||
if started through the shell and this error should never happen. */
|
||||
fprintf(stderr, "Fatal Error: failed to locate installation root.\n");
|
||||
exit(1);
|
||||
#else
|
||||
return "";
|
||||
#endif
|
||||
}
|
||||
|
||||
char *make_native_separator(char* path) {
|
||||
#ifdef __MINGW32__
|
||||
char* c;
|
||||
|
||||
Reference in New Issue
Block a user