Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
link_temp_to_file: don't leave the path truncated on adjust_shared_perm failure
[gitweb.git]
/
sha1_file.c
diff --git
a/sha1_file.c
b/sha1_file.c
index 47e2a29abd6d2ae067d72c0f73bcf4e6afe0a938..5fcad2893fec7739262b06e2883ee3c261768099 100644
(file)
--- a/
sha1_file.c
+++ b/
sha1_file.c
@@
-1383,8
+1383,10
@@
static int link_temp_to_file(const char *tmpfile, const char *filename)
if (dir) {
*dir = 0;
mkdir(filename, 0777);
- if (adjust_shared_perm(filename))
+ if (adjust_shared_perm(filename)) {
+ *dir = '/';
return -2;
+ }
*dir = '/';
if (!link(tmpfile, filename))
return 0;