Index: /trunk/src/kmk/Makefile.kmk
===================================================================
--- /trunk/src/kmk/Makefile.kmk	(revision 2635)
+++ /trunk/src/kmk/Makefile.kmk	(revision 2636)
@@ -131,5 +131,6 @@
 	w32/subproc/w32err.c \
 	w32/compat/dirent.c \
-	w32/pathstuff.c
+	w32/pathstuff.c \
+	w32/imagecache.c
 
 #
Index: /trunk/src/kmk/w32/subproc/sub_proc.c
===================================================================
--- /trunk/src/kmk/w32/subproc/sub_proc.c	(revision 2635)
+++ /trunk/src/kmk/w32/subproc/sub_proc.c	(revision 2636)
@@ -35,4 +35,7 @@
 static char *make_command_line(char *shell_name, char *exec_path, char **argv);
 extern char *xmalloc (unsigned int);
+#ifdef KMK
+extern void kmk_cache_exec_image(const char *); /* imagecache.c */
+#endif
 
 typedef struct sub_process_t {
@@ -455,5 +458,5 @@
 
 #ifdef KMK
-        /* kmk performace: Don't bother looking for shell scripts in .exe files. */
+        /* kmk performance: Don't bother looking for shell scripts in .exe files. */
         exec_path_len = strlen(exec_path);
         if (exec_path_len > 4
@@ -461,4 +464,5 @@
             && !stricmp(exec_path + exec_path_len - 3, "exe")) {
                 exec_handle =  INVALID_HANDLE_VALUE;
+		exec_fname[0] = '\0';
         }
         else {
@@ -600,4 +604,12 @@
 			exec_path ? exec_path : "NULL",
 			command_line ? command_line : "NULL"));
+#ifdef KMK
+		if (exec_fname[0])
+			kmk_cache_exec_image(exec_fname);
+		else if (exec_path)
+			kmk_cache_exec_image(exec_path);
+		else if (argv[0])
+			kmk_cache_exec_image(argv[0]);
+#endif
 		if (CreateProcess(
 			exec_path,
