From: Linus Torvalds Date: Tue, 19 Apr 2005 20:59:17 +0000 (-0700) Subject: Fix init-db shared database case X-Git-Tag: v0.99~809 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=7fa6b4e7692926d2d07adee1ef8e277157929058;p=git.git Fix init-db shared database case Noted by Aaron Straus --- diff --git a/init-db.c b/init-db.c index ff2b11a3..65898fa5 100644 --- a/init-db.c +++ b/init-db.c @@ -24,7 +24,7 @@ int main(int argc, char **argv) sha1_dir = getenv(DB_ENVIRONMENT); if (sha1_dir) { struct stat st; - if (!stat(sha1_dir, &st) < 0 && S_ISDIR(st.st_mode)) + if (!stat(sha1_dir, &st) && S_ISDIR(st.st_mode)) return 0; fprintf(stderr, "DB_ENVIRONMENT set to bad directory %s: ", sha1_dir); }