Index: /trunk/src/kmk/read.c
===================================================================
--- /trunk/src/kmk/read.c	(revision 1820)
+++ /trunk/src/kmk/read.c	(revision 1821)
@@ -2427,6 +2427,14 @@
                       if (f->cmds != 0)
                         {
+#ifndef KMK /* bugfix: Don't chop the chain! */
                           this->next = *d_ptr;
                           *d_ptr = this;
+#else   /* KMK */
+                          struct dep *this_last = this;
+                          while (this_last->next)
+                            this_last = this_last->next;
+                          this_last->next = *d_ptr;
+                          *d_ptr = this;
+#endif  /* KMK */
                         }
                       else
