summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2014-01-06 13:45:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-01-06 17:34:20 (GMT)
commitbf10cf70ad0c777dbbbb00bbb741436e285c2181 (patch)
tree25bfc27da6b48b62026facef9f872a9105159238 /builtin
parent26c8ae2a577cd283ab9fa8ab5e5f0ced568dc034 (diff)
downloadgit-bf10cf70ad0c777dbbbb00bbb741436e285c2181.zip
git-bf10cf70ad0c777dbbbb00bbb741436e285c2181.tar.gz
git-bf10cf70ad0c777dbbbb00bbb741436e285c2181.tar.bz2
safe_create_leading_directories(): split on first of multiple slashes
If the input path has multiple slashes between path components (e.g., "foo//bar"), then the old code was breaking the path at the last slash, not the first one. So in the above example, the second slash was overwritten with NUL, resulting in the parent directory being sought as "foo/". When stat() is called on "foo/", it fails with ENOTDIR if "foo" exists but is not a directory. This caused the wrong path to be taken in the subsequent logic. So instead, split path components at the first intercomponent slash rather than the last one. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
0 files changed, 0 insertions, 0 deletions