diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-04-15 14:11:42 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-04-15 14:11:42 -0700 |
| commit | c7a9ec4728db6f88c0957789f3b77a3e2e8b0ec9 (patch) | |
| tree | 1870ab934b6f8c65dbe26a58116f67e8c5da0594 /path.c | |
| parent | Merge branch 'ma/win32-unix-domain-socket' (diff) | |
| parent | path: remove mksnpath() (diff) | |
| download | git-c7a9ec4728db6f88c0957789f3b77a3e2e8b0ec9.tar.gz git-c7a9ec4728db6f88c0957789f3b77a3e2e8b0ec9.zip | |
Merge branch 'rs/apply-lift-path-length-limit'
"git apply" has been updated to lift the hardcoded pathname length
limit, which in turn allowed a mksnpath() function that is no
longer used.
* rs/apply-lift-path-length-limit:
path: remove mksnpath()
apply: avoid fixed-size buffer in create_one_file()
Diffstat (limited to 'path.c')
| -rw-r--r-- | path.c | 17 |
1 files changed, 0 insertions, 17 deletions
@@ -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); |
