mirror of
https://github.com/git/git.git
synced 2024-10-28 04:49:43 +01:00
path: remove mksnpath()
Remove the function mksnpath(), which has become unused. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
9126cb3186
commit
708f7e0590
3 changed files with 0 additions and 24 deletions
|
@ -92,7 +92,6 @@ cat >.vscode/settings.json.new <<\EOF ||
|
|||
"isexe",
|
||||
"iskeychar",
|
||||
"kompare",
|
||||
"mksnpath",
|
||||
"mktag",
|
||||
"mktree",
|
||||
"mmblob",
|
||||
|
|
17
path.c
17
path.c
|
@ -28,8 +28,6 @@ static int get_st_mode_bits(const char *path, int *mode)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static char bad_path[] = "/bad-path/";
|
||||
|
||||
static struct strbuf *get_pathname(void)
|
||||
{
|
||||
static struct strbuf pathname_array[4] = {
|
||||
|
@ -59,21 +57,6 @@ static void strbuf_cleanup_path(struct strbuf *sb)
|
|||
strbuf_remove(sb, 0, path - sb->buf);
|
||||
}
|
||||
|
||||
char *mksnpath(char *buf, size_t n, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
unsigned len;
|
||||
|
||||
va_start(args, fmt);
|
||||
len = vsnprintf(buf, n, fmt, args);
|
||||
va_end(args);
|
||||
if (len >= n) {
|
||||
strlcpy(buf, bad_path, n);
|
||||
return buf;
|
||||
}
|
||||
return (char *)cleanup_path(buf);
|
||||
}
|
||||
|
||||
static int dir_prefix(const char *buf, const char *dir)
|
||||
{
|
||||
int len = strlen(dir);
|
||||
|
|
6
path.h
6
path.h
|
@ -23,12 +23,6 @@ const char *mkpath(const char *fmt, ...)
|
|||
char *mkpathdup(const char *fmt, ...)
|
||||
__attribute__((format (printf, 1, 2)));
|
||||
|
||||
/*
|
||||
* Construct a path and place the result in the provided buffer `buf`.
|
||||
*/
|
||||
char *mksnpath(char *buf, size_t n, const char *fmt, ...)
|
||||
__attribute__((format (printf, 3, 4)));
|
||||
|
||||
/*
|
||||
* The `git_common_path` family of functions will construct a path into a
|
||||
* repository's common git directory, which is shared by all worktrees.
|
||||
|
|
Loading…
Reference in a new issue