b3cb2e
diff --git a/src/magic.c b/src/magic.c
b3cb2e
index 5403951..2b61080 100644
b3cb2e
--- a/src/magic.c
b3cb2e
+++ b/src/magic.c
b3cb2e
@@ -101,16 +101,21 @@ get_default_magic(void)
b3cb2e
 	if ((home = getenv("HOME")) == NULL)
b3cb2e
 		return MAGIC;
b3cb2e
 
b3cb2e
-	if (asprintf(&hmagicpath, "%s/.magic", home) < 0)
b3cb2e
+	if (asprintf(&hmagicpath, "%s/.magic.mgc", home) < 0)
b3cb2e
 		return MAGIC;
b3cb2e
-	if (stat(hmagicpath, &st) == -1)
b3cb2e
-		goto out;
b3cb2e
-	if (S_ISDIR(st.st_mode)) {
b3cb2e
+	if (stat(hmagicpath, &st) == -1) {
b3cb2e
 		free(hmagicpath);
b3cb2e
-		if (asprintf(&hmagicpath, "%s/%s", home, hmagic) < 0)
b3cb2e
+		if (asprintf(&hmagicpath, "%s/.magic", home) < 0)
b3cb2e
 			return MAGIC;
b3cb2e
-		if (access(hmagicpath, R_OK) == -1)
b3cb2e
+		if (stat(hmagicpath, &st) == -1)
b3cb2e
 			goto out;
b3cb2e
+		if (S_ISDIR(st.st_mode)) {
b3cb2e
+			free(hmagicpath);
b3cb2e
+			if (asprintf(&hmagicpath, "%s/%s", home, hmagic) < 0)
b3cb2e
+				return MAGIC;
b3cb2e
+			if (access(hmagicpath, R_OK) == -1)
b3cb2e
+				goto out;
b3cb2e
+		}
b3cb2e
 	}
b3cb2e
 
b3cb2e
 	if (asprintf(&default_magic, "%s:%s", hmagicpath, MAGIC) < 0)