Fabian Maurer : wininet: Changed usage of UrlEscapeW to fit winapi behavior.

Alexandre Julliard julliard at winehq.org
Wed Dec 14 16:45:28 CST 2016


Module: wine
Branch: master
Commit: 8c39694882537b86d5b54771c7e10f79c0ee58f9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8c39694882537b86d5b54771c7e10f79c0ee58f9

Author: Fabian Maurer <dark.shadow4 at web.de>
Date:   Wed Dec 14 16:47:50 2016 +0100

wininet: Changed usage of UrlEscapeW to fit winapi behavior.

Signed-off-by: Fabian Maurer <dark.shadow4 at web.de>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wininet/http.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index b3c8e66..658342b 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -4189,12 +4189,13 @@ static DWORD HTTP_HandleRedirect(http_request_t *request, LPCWSTR lpszUrl)
     request->path = NULL;
     if (*path)
     {
-        DWORD needed = 0;
+        DWORD needed = 1;
         HRESULT rc;
+        WCHAR dummy = 0;
 
-        rc = UrlEscapeW(path, NULL, &needed, URL_ESCAPE_SPACES_ONLY);
-        if (rc == E_POINTER)
-            needed = strlenW(path)+1;
+        rc = UrlEscapeW(path, &dummy, &needed, URL_ESCAPE_SPACES_ONLY);
+        if (rc != E_POINTER)
+            ERR("Unable to escape string!(%s) (%d)\n",debugstr_w(path),rc);
         request->path = heap_alloc(needed*sizeof(WCHAR));
         rc = UrlEscapeW(path, request->path, &needed,
                         URL_ESCAPE_SPACES_ONLY);




More information about the wine-cvs mailing list