Skip to content

Commit 708f7e0

Browse files
rscharfegitster
authored andcommitted
path: remove mksnpath()
Remove the function mksnpath(), which has become unused. Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9126cb3 commit 708f7e0

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

contrib/vscode/init.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ cat >.vscode/settings.json.new <<\EOF ||
9292
"isexe",
9393
"iskeychar",
9494
"kompare",
95-
"mksnpath",
9695
"mktag",
9796
"mktree",
9897
"mmblob",

path.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ static int get_st_mode_bits(const char *path, int *mode)
2828
return 0;
2929
}
3030

31-
static char bad_path[] = "/bad-path/";
32-
3331
static struct strbuf *get_pathname(void)
3432
{
3533
static struct strbuf pathname_array[4] = {
@@ -59,21 +57,6 @@ static void strbuf_cleanup_path(struct strbuf *sb)
5957
strbuf_remove(sb, 0, path - sb->buf);
6058
}
6159

62-
char *mksnpath(char *buf, size_t n, const char *fmt, ...)
63-
{
64-
va_list args;
65-
unsigned len;
66-
67-
va_start(args, fmt);
68-
len = vsnprintf(buf, n, fmt, args);
69-
va_end(args);
70-
if (len >= n) {
71-
strlcpy(buf, bad_path, n);
72-
return buf;
73-
}
74-
return (char *)cleanup_path(buf);
75-
}
76-
7760
static int dir_prefix(const char *buf, const char *dir)
7861
{
7962
int len = strlen(dir);

path.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ const char *mkpath(const char *fmt, ...)
2323
char *mkpathdup(const char *fmt, ...)
2424
__attribute__((format (printf, 1, 2)));
2525

26-
/*
27-
* Construct a path and place the result in the provided buffer `buf`.
28-
*/
29-
char *mksnpath(char *buf, size_t n, const char *fmt, ...)
30-
__attribute__((format (printf, 3, 4)));
31-
3226
/*
3327
* The `git_common_path` family of functions will construct a path into a
3428
* repository's common git directory, which is shared by all worktrees.

0 commit comments

Comments
 (0)