[ros-diffs] [janderwald] 22202: make _tfullpath pass all msvcrt_winetest dir tests

janderwald at svn.reactos.org janderwald at svn.reactos.org
Sun Jun 4 12:23:28 CEST 2006


Author: janderwald
Date: Sun Jun  4 14:23:28 2006
New Revision: 22202

URL: http://svn.reactos.ru/svn/reactos?rev=22202&view=rev
Log:
make _tfullpath pass all msvcrt_winetest dir tests

Modified:
    trunk/reactos/lib/crt/stdlib/fullpath.c

Modified: trunk/reactos/lib/crt/stdlib/fullpath.c
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/crt/stdlib/fullpath.c?rev=22202&r1=22201&r2=22202&view=diff
==============================================================================
--- trunk/reactos/lib/crt/stdlib/fullpath.c (original)
+++ trunk/reactos/lib/crt/stdlib/fullpath.c Sun Jun  4 14:23:28 2006
@@ -17,8 +17,16 @@
 _TCHAR* _tfullpath(_TCHAR* absPath, const _TCHAR* relPath, size_t maxLength)
 {
     _TCHAR* lpFilePart;
+    DWORD copied;
 
-    if (GetFullPathName(relPath,maxLength,absPath,&lpFilePart) == 0)
+    if (!absPath)
+    {
+        maxLength = MAX_PATH;
+        absPath = malloc(maxLength);
+    }
+
+    copied = GetFullPathName(relPath,maxLength,absPath,&lpFilePart);
+    if (copied == 0 || copied > maxLength)
         return NULL;
 
     return absPath;




More information about the Ros-diffs mailing list