Hans Leidekker : mshtml: Don' t append slashes to opaque protocol identifiers.

Alexandre Julliard julliard at winehq.org
Thu Mar 28 15:30:23 CDT 2013


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Mar 27 17:13:46 2013 +0100

mshtml: Don't append slashes to opaque protocol identifiers.

---

 dlls/mshtml/editor.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c
index dbb2d93..0a58d1f 100644
--- a/dlls/mshtml/editor.c
+++ b/dlls/mshtml/editor.c
@@ -1016,17 +1016,17 @@ static HRESULT query_edit_status(HTMLDocument *This, OLECMD *cmd)
 static INT_PTR CALLBACK hyperlink_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 {
     static const WCHAR wszOther[] = {'(','o','t','h','e','r',')',0};
+    static const WCHAR wszFile[] = {'f','i','l','e',':',0};
+    static const WCHAR wszFtp[] = {'f','t','p',':',0};
+    static const WCHAR wszHttp[] = {'h','t','t','p',':',0};
+    static const WCHAR wszHttps[] = {'h','t','t','p','s',':',0};
+    static const WCHAR wszMailto[] = {'m','a','i','l','t','o',':',0};
+    static const WCHAR wszNews[] = {'n','e','w','s',':',0};
 
     switch (msg)
     {
         case WM_INITDIALOG:
         {
-            static const WCHAR wszFile[] = {'f','i','l','e',':',0};
-            static const WCHAR wszFtp[] = {'f','t','p',':',0};
-            static const WCHAR wszHttp[] = {'h','t','t','p',':',0};
-            static const WCHAR wszHttps[] = {'h','t','t','p','s',':',0};
-            static const WCHAR wszMailto[] = {'m','a','i','l','t','o',':',0};
-            static const WCHAR wszNews[] = {'n','e','w','s',':',0};
             INT def_idx;
             HWND hwndCB = GetDlgItem(hwnd, IDC_TYPE);
             HWND hwndURL = GetDlgItem(hwnd, IDC_URL);
@@ -1102,8 +1102,9 @@ static INT_PTR CALLBACK hyperlink_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LP
                     /* add new protocol */
                     if (*type != '\0')
                     {
-                        memcpy(url, type, strlenW(type) * sizeof(WCHAR));
-                        memcpy(url + strlenW(type), wszSlashSlash, sizeof(wszSlashSlash));
+                        memcpy(url, type, (strlenW(type) + 1) * sizeof(WCHAR));
+                        if (strcmpW(type, wszMailto) && strcmpW(type, wszNews))
+                            memcpy(url + strlenW(type), wszSlashSlash, sizeof(wszSlashSlash));
                     }
 
                     SetWindowTextW(hwndURL, url);




More information about the wine-cvs mailing list