From 51355b1ede40a910bf4a62f9a8d0cbd7abcdecf7 Mon Sep 17 00:00:00 2001 From: Steffen Prohaska Date: Sat, 17 Nov 2007 16:45:19 +0100 Subject: [PATCH] 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 --- cache.h | 1 - path.c | 35 ----------------------------------- 2 files changed, 36 deletions(-) diff --git a/cache.h b/cache.h index 1fbc9a1987..550e8ad192 100644 --- a/cache.h +++ b/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 *); diff --git a/path.c b/path.c index 01f35d5e7d..2a76269705 100644 --- a/path.c +++ b/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, '\\'); /* \bin\ <- p */ - if (p) { - *p = '\0'; - p = strrchr(prefix, '\\'); /* \ <- 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;