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:
Steffen Prohaska
2007-11-17 16:45:19 +01:00
parent e9d8b9207e
commit 51355b1ede
2 changed files with 0 additions and 36 deletions

View File

@@ -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
View File

@@ -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;