diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-08-25 16:00:20 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-25 16:00:20 -0700 |
commit | e11fa9a460b51947c3ef28be84346a1e90d027ca (patch) | |
tree | f1c218291b20b8ee96b57e4342e6d053a9e72428 /setup.c | |
parent | 957450054cfbbe0d4ae8d33f7b74eace6e290f16 (diff) | |
parent | 068762846634dff73a18d71188736e0ded03a1cc (diff) | |
download | git-e11fa9a460b51947c3ef28be84346a1e90d027ca.tar.gz |
Merge branch 'di/parse-options-split'
* di/parse-options-split:
Reduce parse-options.o dependencies
parse-options: export opterr, optbug
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 28 |
1 files changed, 0 insertions, 28 deletions
@@ -40,34 +40,6 @@ char *prefix_path(const char *prefix, int len, const char *path) return sanitized; } -/* - * Unlike prefix_path, this should be used if the named file does - * not have to interact with index entry; i.e. name of a random file - * on the filesystem. - */ -const char *prefix_filename(const char *pfx, int pfx_len, const char *arg) -{ - static char path[PATH_MAX]; -#ifndef WIN32 - if (!pfx_len || is_absolute_path(arg)) - return arg; - memcpy(path, pfx, pfx_len); - strcpy(path + pfx_len, arg); -#else - char *p; - /* don't add prefix to absolute paths, but still replace '\' by '/' */ - if (is_absolute_path(arg)) - pfx_len = 0; - else if (pfx_len) - memcpy(path, pfx, pfx_len); - strcpy(path + pfx_len, arg); - for (p = path + pfx_len; *p; p++) - if (*p == '\\') - *p = '/'; -#endif - return path; -} - int check_filename(const char *prefix, const char *arg) { const char *name; |