diff -urpN john-1.7.8-jumbo-6rc1/src/config.c john-1.7.8-jumbo-6a/src/config.c
--- john-1.7.8-jumbo-6rc1/src/config.c	2011-05-17 16:13:02.000000000 +0000
+++ john-1.7.8-jumbo-6a/src/config.c	2011-08-26 17:56:41.781250000 +0000
@@ -20,6 +20,7 @@
 
 char *cfg_name = NULL;
 static struct cfg_section *cfg_database = NULL;
+static int cfg_recursion;
 
 static char *trim(char *s)
 {
@@ -91,7 +92,27 @@ static int cfg_process_line(char *line,
 	char *p;
 
 	line = trim(line);
-	if (!*line || *line == '#' || *line == ';') return 0;
+	if (!*line || *line == '#' || *line == ';') {
+		char *p2;
+		if (strncmp(line, "#include ", 9))
+			return 0;
+		// Ok, we are including a file.
+
+		p = strchr(line, '\"');
+		if (!p) return 0;
+		p2 = strchr(&p[1], '\"');
+		if (!p2 || p2-p == 1) return 0;
+		*p2 = 0;
+		++p;
+		if (cfg_recursion == 4) {
+			fprintf(stderr, "ERROR, #include recursion too deep in john.ini processing (file #include \"%s\"\n", p);
+			return 1;
+		}
+		cfg_recursion++;
+		cfg_init(p, 0);
+		cfg_recursion--;
+		return 0;
+	}
 
 	if (*line == '[') {
 		if ((p = strchr(line, ']'))) *p = 0; else return 1;
@@ -125,10 +146,15 @@ void cfg_init(char *name, int allow_miss
 	FILE *file;
 	char line[LINE_BUFFER_SIZE];
 	int number;
+	char home_name[PATH_BUFFER_SIZE];
+
+	if (cfg_database && !cfg_recursion) return;
 
-	if (cfg_database) return;
+	sprintf (home_name, "$JOHN/%s", name);
 
-	if (!(file = fopen(path_expand(name), "r"))) {
+	if (!(file = fopen(path_expand(name), "r")) && 
+		!(file = fopen(path_expand_ex(name), "r")) && 
+		!(file = fopen(path_expand(home_name), "r"))) {
 		if (allow_missing && errno == ENOENT) return;
 		pexit("fopen: %s", path_expand(name));
 	}
diff -urpN john-1.7.8-jumbo-6rc1/src/john.c john-1.7.8-jumbo-6a/src/john.c
--- john-1.7.8-jumbo-6rc1/src/john.c	2011-08-26 14:24:15.890625000 +0000
+++ john-1.7.8-jumbo-6a/src/john.c	2011-08-26 17:56:41.828125000 +0000
@@ -396,8 +396,10 @@ static void john_init(char *name, int ar
 
     if (options.flags & FLG_CONFIG_CLI)
     {
-      cfg_init(options.config, 1);
-      cfg_init(CFG_ALT_NAME, 0);
+		path_init_ex(options.config);
+		cfg_init(options.config, 1);
+		cfg_init(CFG_FULL_NAME, 1);
+		cfg_init(CFG_ALT_NAME, 0);
     }
     else
     {
diff -urpN john-1.7.8-jumbo-6rc1/src/path.c john-1.7.8-jumbo-6a/src/path.c
--- john-1.7.8-jumbo-6rc1/src/path.c	2010-02-25 23:39:38.000000000 +0000
+++ john-1.7.8-jumbo-6a/src/path.c	2011-08-26 17:56:41.718750000 +0000
@@ -12,6 +12,8 @@
 
 static char *john_home_path = NULL;
 static int john_home_length;
+static char *john_home_pathex = NULL;
+static int john_home_lengthex;
 
 #if JOHN_SYSTEMWIDE
 #include <unistd.h>
@@ -60,17 +62,76 @@ void path_init(char **argv)
 		fprintf(stderr, "Created directory: %s\n", private);
 #endif
 #else
-	if (argv[0])
-	if (!john_home_path && (pos = strrchr(argv[0], '/'))) {
-		john_home_length = pos - argv[0] + 1;
-		if (john_home_length >= PATH_BUFFER_SIZE) return;
-
-		john_home_path = mem_alloc(PATH_BUFFER_SIZE);
-		memcpy(john_home_path, argv[0], john_home_length);
+	if (argv[0]) {
+		int dos=0;
+		if (!john_home_path) {
+			pos = strrchr(argv[0], '/');
+			if (!pos) {
+				pos = strrchr(argv[0], '\\'); // handle this for MSVC and MinGW which use 'DOS' style C:\path\run\john  syntax.
+				if (pos>argv[0] && argv[0][1] == ':') {
+					argv[0] += 2;
+					dos = 1;
+				}
+			}
+			if (pos) {
+				john_home_length = pos - argv[0] + 1;
+				if (john_home_length >= PATH_BUFFER_SIZE) return;
+
+				john_home_path = mem_alloc(PATH_BUFFER_SIZE);
+				memcpy(john_home_path, argv[0], john_home_length);
+				john_home_path[john_home_length] = 0;
+				pos = strchr(john_home_path, '\\');
+				while (dos && pos) {
+					*pos = '/';
+					pos = strchr(pos, '\\');
+				}
+			}
+		}
 	}
 #endif
 }
 
+void path_init_ex(const char *path)
+{
+	int dos = 0;
+	char *pos;
+
+	pos = strrchr(path, '/');
+	if (!pos) {
+		pos = strrchr(path, '\\');
+		if (pos>path && path[1] == ':') {
+			path += 2;
+			dos = 1;
+		}
+		else if (pos == path)
+			dos = 1;
+	}
+	if (pos) {
+		john_home_lengthex = pos - path + 1;
+		if (john_home_lengthex >= PATH_BUFFER_SIZE) return;
+
+		john_home_pathex = mem_alloc(PATH_BUFFER_SIZE);
+		memcpy(john_home_pathex, path, john_home_lengthex);
+		john_home_pathex[john_home_lengthex] = 0;
+		pos = strchr(john_home_pathex, '\\');
+		while (dos && pos) {
+			*pos = '/';
+			pos = strchr(pos, '\\');
+		}
+	}
+}
+
+char *path_expand_ex(char *name)
+{
+	if (john_home_pathex &&
+	    john_home_lengthex + strlen(name) < PATH_BUFFER_SIZE) {
+		strnzcpy(&john_home_pathex[john_home_lengthex], name,
+			PATH_BUFFER_SIZE - john_home_lengthex);
+		return john_home_pathex;
+	}
+	return name;
+}
+
 char *path_expand(char *name)
 {
 	if (!strncmp(name, "$JOHN/", 6)) {
diff -urpN john-1.7.8-jumbo-6rc1/src/path.h john-1.7.8-jumbo-6a/src/path.h
--- john-1.7.8-jumbo-6rc1/src/path.h	2010-02-25 23:24:20.000000000 +0000
+++ john-1.7.8-jumbo-6a/src/path.h	2011-08-26 18:20:29.906250000 +0000
@@ -22,6 +22,17 @@ extern void path_init(char **argv);
 extern char *path_expand(char *name);
 
 /*
+ * these 2 are used when -conf=path is used.  Here, we have a 'base'
+ * directory other than where john ran from (or likely can). Thus we
+ * want to base file names from there. Since we have added #include
+ * to the john.conf processing, we do want to look in the same
+ * dir where we loaded the john.conf file, if -conf= arg is used.
+ */
+extern void path_init_ex(const char *name);
+extern char *path_expand_ex(char *name);
+
+
+/*
  * Generates a filename for the given session name and filename suffix.
  * Memory for the resulting filename is allocated with mem_alloc_tiny().
  */
