wininet: Fix URLCache_LocalFileNameToPathA to return a full path, rather than just...
commitcdd135c2f3024835192d7fef55e3a0e9e2bbfd73
authorRob Shearman <rob@codeweavers.com>
Wed, 12 Mar 2008 15:36:00 +0000 (12 15:36 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 12 Mar 2008 16:58:20 +0000 (12 17:58 +0100)
tree621877c95f47d65503fe3bfc06ed6939781eff34
parentc46279ced7991c2c46ea6bf2b59e42f8bbfb1485
wininet: Fix URLCache_LocalFileNameToPathA to return a full path, rather than just the container path.

This was caused by path_len including the nul-terminator and so the rest
of the string was being added after the nul-terminator, which is
incorrect. This is fixed by making path_len not include the nul-terminator.

Also fix a few other issues with the function, like not passing a
correct length into the second call to WideCharToMultiByte, nRequired
being calculated incorrectly and the string not always being nul-terminated.

Add a test for this function by testing the lpszLocalFileName field
obtained from RetrieveUrlCacheEntryFileA.
dlls/wininet/tests/urlcache.c
dlls/wininet/urlcache.c