X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=path.c;h=f4ed979997b6a968ba1987a199beae39035d5da2;hb=24b6177e0261efba063c0b83ae0cdc5993945da9;hp=42609524a55ad017557d48bedf26906cc4405d0a;hpb=6e863d6d129a1b6a13c66d0bb03f3d43db6c51fe;p=git.git diff --git a/path.c b/path.c index 42609524a..f4ed97999 100644 --- a/path.c +++ b/path.c @@ -283,7 +283,7 @@ int adjust_shared_perm(const char *path) ? (S_IXGRP|S_IXOTH) : 0)); if (S_ISDIR(mode)) - mode |= S_ISGID; + mode |= FORCE_DIR_SET_GID; if ((mode & st.st_mode) != mode && chmod(path, mode) < 0) return -2; return 0; @@ -311,8 +311,10 @@ const char *make_absolute_path(const char *path) if (last_slash) { *last_slash = '\0'; last_elem = xstrdup(last_slash + 1); - } else + } else { last_elem = xstrdup(buf); + *buf = '\0'; + } } if (*buf) {