aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-08 16:13:19 -0800
committerJunio C Hamano <gitster@pobox.com>2008-11-08 16:13:19 -0800
commit8b1981d32b41f1b4e26d8d96a3c6e63b9bc746b0 (patch)
tree13daae95357e1877e57e742dd9ea77ca5d3e3b16 /cache.h
parent3b8572a4297d8720b359c82e1dd9afeb45cda3cd (diff)
parenta4f34cbb4cea1f0b0e625b528f269f4b517c64f8 (diff)
downloadgit-8b1981d32b41f1b4e26d8d96a3c6e63b9bc746b0.tar.gz
git-8b1981d32b41f1b4e26d8d96a3c6e63b9bc746b0.tar.xz
Merge branch 'ar/maint-mksnpath' into maint
* ar/maint-mksnpath: Use git_pathdup instead of xstrdup(git_path(...)) git_pathdup: returns xstrdup-ed copy of the formatted path Fix potentially dangerous use of git_path in ref.c Add git_snpath: a .git path formatting routine with output buffer Fix potentially dangerous uses of mkpath and git_path Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.c Add mksnpath which allows you to specify the output buffer Conflicts: builtin-revert.c rerere.c
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 39f24ad82..a1e4982cd 100644
--- a/cache.h
+++ b/cache.h
@@ -484,6 +484,13 @@ extern int check_repository_format(void);
#define DATA_CHANGED 0x0020
#define TYPE_CHANGED 0x0040
+extern char *mksnpath(char *buf, size_t n, const char *fmt, ...)
+ __attribute__((format (printf, 3, 4)));
+extern char *git_snpath(char *buf, size_t n, const char *fmt, ...)
+ __attribute__((format (printf, 3, 4)));
+extern char *git_pathdup(const char *fmt, ...)
+ __attribute__((format (printf, 1, 2)));
+
/* Return a statically allocated filename matching the sha1 signature */
extern char *mkpath(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
extern char *git_path(const char *fmt, ...) __attribute__((format (printf, 1, 2)));