# [PATCH] trivial fix for init-db

1 messages from 2005-04-18 to 2005-04-18. Participants: Aaron Straus.
Thread: https://gitlist.dev/t/117

## Aaron Straus, 2005-04-18 23:14

Subject: [PATCH] trivial fix for init-db
Message-ID: <20050418231435.GF8929@hydra>
URL: https://gitlist.dev/e/20050418231435.GF8929%40hydra

```
This makes init-db work for common object database.

Signed-Off-By: Aaron Straus <aaron@merfinllc.com>

init-db.c: aa00fbb1b95624f6c30090a17354c9c08a6ac596
--- 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);
 	}

```
