Index: /trunk/src/misc/Makefile.kmk
===================================================================
--- /trunk/src/misc/Makefile.kmk	(revision 3207)
+++ /trunk/src/misc/Makefile.kmk	(revision 3208)
@@ -31,4 +31,5 @@
 kmk_time_DEFS = KBUILD_SVN_REV=$(KBUILD_SVN_REV)
 kmk_time_SOURCES = kmk_time.c
+kmk_time_SOURCES.win = ../lib/quote_argv.c
 
 include $(KBUILD_PATH)/subfooter.kmk
Index: /trunk/src/misc/kmk_time.c
===================================================================
--- /trunk/src/misc/kmk_time.c	(revision 3207)
+++ /trunk/src/misc/kmk_time.c	(revision 3208)
@@ -40,4 +40,5 @@
 # include <process.h>
 # include <Windows.h>
+# include "quote_argv.h"
 #else
 # include <unistd.h>
@@ -194,4 +195,5 @@
     int                 cTimes = 1;
 #if defined(_MSC_VER)
+    int                 fUnquoted = 0;
     FILETIME ftStart,   ft;
     unsigned _int64     usMin, usMax, usAvg, usTotal, usCur;
@@ -233,4 +235,11 @@
             else if (!strcmp(psz, "-iterations"))
                 psz = "i";
+#if defined(_MSC_VER)
+            else if (!strcmp(psz, "-unquoted"))
+            {
+                fUnquoted = 1;
+                continue;
+            }
+#endif
         }
 
@@ -243,5 +252,5 @@
             case 'V':
                 printf("kmk_time - kBuild version %d.%d.%d (r%u)\n"
-                       "Copyright (C) 2007-2009 knut st. osmundsen\n",
+                       "Copyright (C) 2007-2018 knut st. osmundsen\n",
                        KBUILD_VERSION_MAJOR, KBUILD_VERSION_MINOR, KBUILD_VERSION_PATCH,
                        KBUILD_SVN_REV);
@@ -287,11 +296,14 @@
          * Execute the program (it's actually supposed to be a command I think, but wtf).
          */
-
 #if defined(_MSC_VER)
-        /** @todo
-         * We'll have to find the '--' in the commandline and pass that
-         * on to CreateProcess or spawn. Otherwise, the argument qouting
-         * is gonna be messed up.
-         */
+        if (!fUnquoted)
+        {
+            if (quote_argv(argc - i, &argv[i], 0 /*fWatcomBrainDamage*/, 0 /*fFreeOrLeak*/) != 0)
+            {
+                fprintf(stderr, "%s: error: quote_argv failed\n");
+                return 8;
+            }
+        }
+
         GetSystemTimeAsFileTime(&ftStart);
         rc = _spawnvp(_P_WAIT, argv[i], &argv[i]);
