From 5c8fb36ad359ebbe08c785cc733241cd73d34f70 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Sun, 4 Jun 2006 10:23:28 +0000 Subject: [PATCH] make _tfullpath pass all msvcrt_winetest dir tests svn path=/trunk/; revision=22202 --- reactos/lib/crt/stdlib/fullpath.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/reactos/lib/crt/stdlib/fullpath.c b/reactos/lib/crt/stdlib/fullpath.c index 0ed77c88265..61d6d114c66 100644 --- a/reactos/lib/crt/stdlib/fullpath.c +++ b/reactos/lib/crt/stdlib/fullpath.c @@ -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;