Changelog: files/directory.c: GetTempPath[A|W] Acount for a possible missing backslash for size calculation -- Uwe Bonnes [EMAIL PROTECTED]
Free Software: If you contribute nothing, expect nothing -- Index: wine/files/directory.c =================================================================== RCS file: /home/wine/wine/files/directory.c,v retrieving revision 1.45 diff -u -r1.45 directory.c --- wine/files/directory.c 9 Mar 2002 23:50:37 -0000 1.45 +++ wine/files/directory.c 9 May 2002 16:31:31 -0000 @@ -186,6 +186,21 @@ if (!(ret = GetEnvironmentVariableA( "TEMP", path, count ))) if (!(ret = GetCurrentDirectoryA( count, path ))) return 0; + if ((ret) && (ret +1 > count)) + /* We need to return the required length including the + trailing backslash. So we have to acually get the string + to test if the backslash is there */ + { + char *buffer; + UINT ret1; + if ((buffer = HeapAlloc( GetProcessHeap(), 0, ret ))) + { + ret1 = GetTempPathA(ret,buffer); + if (buffer[ret1-1] != '\\') + ret++; + HeapFree( GetProcessHeap(), 0, buffer ); + } + } if (count && (ret < count - 1) && (path[ret-1] != '\\')) { path[ret++] = '\\'; @@ -207,6 +222,21 @@ if (!(ret = GetEnvironmentVariableW( temp, path, count ))) if (!(ret = GetCurrentDirectoryW( count, path ))) return 0; + if ((ret) && (ret +1 > count)) + /* We need to return the required length including the + trailing backslash. So we have to acually get the string + to test if the backslash is there */ + { + WCHAR *buffer; + UINT ret1; + if ((buffer = HeapAlloc( GetProcessHeap(), 0, ret ))) + { + ret1 = GetTempPathW(ret,buffer); + if (buffer[ret1-1] != '\\') + ret++; + HeapFree( GetProcessHeap(), 0, buffer ); + } + } if (count && (ret < count - 1) && (path[ret-1] != '\\')) { path[ret++] = '\\';