Fix splitpath and wsplitpath for the file extension.

diff --git a/dlls/msvcrt/dir.c b/dlls/msvcrt/dir.c
index a5ba3da..ef32d04 100644
--- a/dlls/msvcrt/dir.c
+++ b/dlls/msvcrt/dir.c
@@ -463,8 +463,11 @@
     }
     else if (dir) dir[0] = 0;
 
-    /* look for extension */
-    for (end = inpath; *end; end++) if (*end == '.') break;
+    /* look for extension: what's after the last dot */
+    end = NULL;
+    for (p = inpath; *p; p++) if (*p == '.') end = p;
+
+    if (!end) end = p; /* there's no extension */
 
     if (fname)
     {