Index: branches/libc-0.6/src/emx/include/InnoTekLIBC/backend.h
===================================================================
--- branches/libc-0.6/src/emx/include/InnoTekLIBC/backend.h	(revision 3766)
+++ branches/libc-0.6/src/emx/include/InnoTekLIBC/backend.h	(revision 3771)
@@ -183,7 +183,10 @@
 /** Flags for __libc_Back_fsPathResolve().
  * @{ */
-#define __LIBC_BACKFS_FLAGS_RESOLVE_FULL    0
+#define __LIBC_BACKFS_FLAGS_RESOLVE_FULL        0
+/** Resolves and verfies the entire path, but it's ok if the last component
+ * does not exist. */
+#define __LIBC_BACKFS_FLAGS_RESOLVE_FULL_MAYBE  0x01
 /** Get the native path instead, no unix root translations. */
-#define __LIBC_BACKFS_FLAGS_RESOLVE_NATIVE  0x10
+#define __LIBC_BACKFS_FLAGS_RESOLVE_NATIVE      0x10
 /** @} */
 
Index: branches/libc-0.6/src/emx/src/lib/misc/_realrealpath.c
===================================================================
--- branches/libc-0.6/src/emx/src/lib/misc/_realrealpath.c	(revision 3766)
+++ branches/libc-0.6/src/emx/src/lib/misc/_realrealpath.c	(revision 3771)
@@ -39,17 +39,19 @@
 
 /**
- * Gets the absolute native path. This is used when path and such is passed on to
- * non libc processes.
+ * Gets the absolute native path.
+ *
+ * This is used when path and such is passed on to non-kLibC processes.
  *
  * @returns Pointer to the resolved path.
  * @returns NULL and errno on failure.
  * @param   pszPath     The path to resolve
- * @param   pszResolved Where to put the resolved path.
- *                      If NULL a fitting buffer is malloc'ed.
- * @param   cchResolved Size of the passed in buffer. Minimum size of an allocated buffer.
+ * @param   pszResolved Where to put the resolved path.  If NULL, a fitting
+ *                      buffer is malloc'ed.
+ * @param   cbResolved  Size of the passed in buffer. Minimum size of an
+ *                      allocated buffer.
  */
-char	*_realrealpath(const char *pszPath, char *pszResolved, size_t cchResolved)
+char	*_realrealpath(const char *pszPath, char *pszResolved, size_t cbResolved)
 {
-    LIBCLOG_ENTER("pszPath=%p:{%s} pszResolved=%p cchResolved=%d\n", (void *)pszPath, pszPath, pszResolved, cchResolved);
+    LIBCLOG_ENTER("pszPath=%p:{%s} pszResolved=%p cbResolved=%d\n", (void *)pszPath, pszPath, pszResolved, cbResolved);
 
     if (!pszPath)
@@ -65,11 +67,11 @@
         if (psz)
         {
-            rc = __libc_Back_fsPathResolve(pszPath, psz, PATH_MAX, __LIBC_BACKFS_FLAGS_RESOLVE_NATIVE);
+            rc = __libc_Back_fsPathResolve(pszPath, psz, PATH_MAX, __LIBC_BACKFS_FLAGS_RESOLVE_NATIVE | __LIBC_BACKFS_FLAGS_RESOLVE_FULL_MAYBE);
             if (!rc)
             {
                 char *pszOld = psz;
                 int cch = strlen(psz) + 1;
-                if (cch < cchResolved)
-                    cch = cchResolved;
+                if (cch < cbResolved)
+                    cch = cbResolved;
                 psz = realloc(psz, cch);
                 if (!psz)
@@ -86,5 +88,5 @@
 
     char *pszRet = pszResolved;
-    rc = __libc_Back_fsPathResolve(pszPath, pszResolved, cchResolved, __LIBC_BACKFS_FLAGS_RESOLVE_NATIVE);
+    rc = __libc_Back_fsPathResolve(pszPath, pszResolved, cbResolved, __LIBC_BACKFS_FLAGS_RESOLVE_NATIVE | __LIBC_BACKFS_FLAGS_RESOLVE_FULL_MAYBE);
     if (!rc)
         LIBCLOG_RETURN_MSG(pszRet, "ret %p - pszResolved=%p:{%s}\n", pszRet, pszResolved, pszResolved);
Index: branches/libc-0.6/src/emx/src/lib/misc/realpath.c
===================================================================
--- branches/libc-0.6/src/emx/src/lib/misc/realpath.c	(revision 3766)
+++ branches/libc-0.6/src/emx/src/lib/misc/realpath.c	(revision 3771)
@@ -65,5 +65,5 @@
         if (psz)
         {
-            rc = __libc_Back_fsPathResolve(path, psz, PATH_MAX, 0);
+            rc = __libc_Back_fsPathResolve(path, psz, PATH_MAX, __LIBC_BACKFS_FLAGS_RESOLVE_FULL_MAYBE);
             if (!rc)
             {
@@ -84,5 +84,5 @@
 
     char *pszRet = resolved_path;
-    rc = __libc_Back_fsPathResolve(path, resolved_path, PATH_MAX, 0);
+    rc = __libc_Back_fsPathResolve(path, resolved_path, PATH_MAX, __LIBC_BACKFS_FLAGS_RESOLVE_FULL_MAYBE);
     if (!rc)
         LIBCLOG_RETURN_MSG(pszRet, "ret %p - resolved_path=%p:{%s}\n", pszRet, resolved_path, resolved_path);
Index: branches/libc-0.6/src/emx/src/lib/sys/b_fsPathResolve.c
===================================================================
--- branches/libc-0.6/src/emx/src/lib/sys/b_fsPathResolve.c	(revision 3766)
+++ branches/libc-0.6/src/emx/src/lib/sys/b_fsPathResolve.c	(revision 3771)
@@ -64,8 +64,11 @@
      * Resolve to native path.
      */
-    int     fInUnixTree;
-    char    szNativePath[PATH_MAX];
-    szNativePath[0] = '\0';
-    rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL | BACKFS_FLAGS_RESOLVE_DIR_MAYBE, szNativePath, &fInUnixTree);
+    int             fInUnixTree = 0;
+    char            szNativePath[PATH_MAX];
+    unsigned int    fBackFsFlags = fFlags & __LIBC_BACKFS_FLAGS_RESOLVE_FULL_MAYBE
+                                 ? BACKFS_FLAGS_RESOLVE_DIR_MAYBE | BACKFS_FLAGS_RESOLVE_FULL_MAYBE
+                                 : BACKFS_FLAGS_RESOLVE_DIR_MAYBE | BACKFS_FLAGS_RESOLVE_FULL;
+    szNativePath[0] = szNativePath[1] = szNativePath[2] = szNativePath[3] = '\0';
+    rc = __libc_back_fsResolve(pszPath, fBackFsFlags, szNativePath, &fInUnixTree);
 
     /*
@@ -73,5 +76,7 @@
      */
     char *pszSrc = &szNativePath[0];
-    if (!(fFlags & __LIBC_BACKFS_FLAGS_RESOLVE_NATIVE) && fInUnixTree)
+    if (   !(fFlags & __LIBC_BACKFS_FLAGS_RESOLVE_NATIVE)
+        && fInUnixTree
+        && *pszSrc)
     {
         pszSrc += __libc_gcchUnixRoot;
