Index: /trunk/include/iprt/cpp/path.h
===================================================================
--- /trunk/include/iprt/cpp/path.h	(revision 78099)
+++ /trunk/include/iprt/cpp/path.h	(revision 78100)
@@ -45,5 +45,5 @@
  *
  * @returns IPRT status code.
- * @param   rStrAbs         Reference to the destiation string.
+ * @param   rStrAbs         Reference to the destination string.
  * @param   pszRelative     The relative source string.
  */
@@ -54,8 +54,21 @@
     if (RT_SUCCESS(rc))
     {
-        char *pszDst = rStrAbs.mutableRaw();
-        rc = RTPathAbs(pszRelative, pszDst, rStrAbs.capacity());
-        if (RT_FAILURE(rc))
+        unsigned cTries = 8;
+        for (;;)
+        {
+            char *pszDst = rStrAbs.mutableRaw();
+            size_t cbCap = rStrAbs.capacity();
+            rc = RTPathAbsEx(NULL, pszRelative, RTPATH_STR_F_STYLE_HOST, pszDst, &cbCap);
+            if (RT_SUCCESS(rc))
+                break;
             *pszDst = '\0';
+            if (rc != VERR_BUFFER_OVERFLOW)
+                break;
+            if (--cTries == 0)
+                break;
+            rc = rStrAbs.reserveNoThrow(RT_MIN(RT_ALIGN_Z(cbCap, 64), RTPATH_MAX));
+            if (RT_FAILURE(rc))
+                break;
+        }
         rStrAbs.jolt();
     }
@@ -68,5 +81,5 @@
  *
  * @returns IPRT status code.
- * @param   rStrAbs         Reference to the destiation string.
+ * @param   rStrAbs         Reference to the destination string.
  * @param   rStrRelative    Reference to the relative source string.
  */
@@ -77,9 +90,67 @@
 
 
+
+/**
+ * RTPathAbsEx() wrapper for working directly on a RTCString instance.
+ *
+ * @returns IPRT status code.
+ * @param   rStrAbs         Reference to the destination string.
+ * @param   pszBase         The base path, optional.
+ * @param   pszRelative     The relative source string.
+ * @param   fFlags          RTPATH_STR_F_STYLE_XXX and RTPATHABS_F_XXX flags.
+ */
+DECLINLINE(int) RTPathAbsExCxx(RTCString &rStrAbs, const char *pszBase, const char *pszRelative, uint32_t fFlags = RTPATH_STR_F_STYLE_HOST)
+{
+    Assert(rStrAbs.c_str() != pszRelative);
+    int rc = rStrAbs.reserveNoThrow(RTPATH_MAX);
+    if (RT_SUCCESS(rc))
+    {
+        unsigned cTries = 8;
+        for (;;)
+        {
+            char *pszDst = rStrAbs.mutableRaw();
+            size_t cbCap = rStrAbs.capacity();
+            rc = RTPathAbsEx(pszBase, pszRelative, fFlags, pszDst, &cbCap);
+            if (RT_SUCCESS(rc))
+                break;
+            *pszDst = '\0';
+            if (rc != VERR_BUFFER_OVERFLOW)
+                break;
+            if (--cTries == 0)
+                break;
+            rc = rStrAbs.reserveNoThrow(RT_MIN(RT_ALIGN_Z(cbCap, 64), RTPATH_MAX));
+            if (RT_FAILURE(rc))
+                break;
+        }
+        rStrAbs.jolt();
+    }
+    return rc;
+}
+
+
+DECLINLINE(int) RTPathAbsExCxx(RTCString &rStrAbs, RTCString const &rStrBase, RTCString const &rStrRelative, uint32_t fFlags = RTPATH_STR_F_STYLE_HOST)
+{
+    return RTPathAbsExCxx(rStrAbs, rStrBase.c_str(), rStrRelative.c_str(), fFlags);
+}
+
+
+DECLINLINE(int) RTPathAbsExCxx(RTCString &rStrAbs, const char *pszBase, RTCString const &rStrRelative, uint32_t fFlags = RTPATH_STR_F_STYLE_HOST)
+{
+    return RTPathAbsExCxx(rStrAbs, pszBase, rStrRelative.c_str(), fFlags);
+}
+
+
+DECLINLINE(int) RTPathAbsExCxx(RTCString &rStrAbs, RTCString const &rStrBase, const char *pszRelative, uint32_t fFlags = RTPATH_STR_F_STYLE_HOST)
+{
+    return RTPathAbsExCxx(rStrAbs, rStrBase.c_str(), pszRelative, fFlags);
+}
+
+
+
 /**
  * RTPathAppPrivateNoArch() wrapper for working directly on a RTCString instance.
  *
  * @returns IPRT status code.
- * @param   rStrDst         Reference to the destiation string.
+ * @param   rStrDst         Reference to the destination string.
  */
 DECLINLINE(int) RTPathAppPrivateNoArchCxx(RTCString &rStrDst)
@@ -103,5 +174,5 @@
  *
  * @returns IPRT status code.
- * @param   rStrDst         Reference to the destiation string.
+ * @param   rStrDst         Reference to the destination string.
  * @param   pszAppend       One or more components to append to the path already
  *                          present in @a rStrDst.
@@ -135,5 +206,5 @@
  *
  * @returns IPRT status code.
- * @param   rStrDst         Reference to the destiation string.
+ * @param   rStrDst         Reference to the destination string.
  * @param   rStrAppend      One or more components to append to the path already
  *                          present in @a rStrDst.
