aboutsummaryrefslogtreecommitdiffstats
path: root/path.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-02-14 12:54:23 -0800
committerJunio C Hamano <gitster@pobox.com>2020-02-14 12:54:23 -0800
commitaa21cc97bd10ab0b62f6d951ff2ff725261e326e (patch)
tree69e983408fd1a4f599ea00d6b70599a00282be06 /path.c
parent883326077a1995a5ea122c298ff47fcd85782c49 (diff)
parent5290d4513496d89f84570985a0e02e97dff477ff (diff)
downloadgit-aa21cc97bd10ab0b62f6d951ff2ff725261e326e.tar.gz
Merge branch 'jk/alloc-cleanups'
Misc code clean-ups. * jk/alloc-cleanups: tree-walk.c: break circular dependency with unpack-trees traverse_trees(): use stack array for name entries walker_fetch(): avoid raw array length computation normalize_path_copy(): document "dst" size expectations
Diffstat (limited to 'path.c')
-rw-r--r--path.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/path.c b/path.c
index a76eec8b96..88cf593007 100644
--- a/path.c
+++ b/path.c
@@ -1077,6 +1077,8 @@ const char *remove_leading_path(const char *in, const char *prefix)
/*
* It is okay if dst == src, but they should not overlap otherwise.
+ * The "dst" buffer must be at least as long as "src"; normalizing may shrink
+ * the size of the path, but will never grow it.
*
* Performs the following normalizations on src, storing the result in dst:
* - Ensures that components are separated by '/' (Windows only)