Paul Chitescu : shdocvw: Strip out initial whitespaces and quotes around an URL on iexplore command line .

Alexandre Julliard julliard at winehq.org
Fri Jul 2 10:21:58 CDT 2010


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

Author: Paul Chitescu <paulc at voip.null.ro>
Date:   Fri Jul  2 16:16:27 2010 +0300

shdocvw: Strip out initial whitespaces and quotes around an URL on iexplore command line.

---

 dlls/shdocvw/iexplore.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/shdocvw/iexplore.c b/dlls/shdocvw/iexplore.c
index e4e7618..0984889 100644
--- a/dlls/shdocvw/iexplore.c
+++ b/dlls/shdocvw/iexplore.c
@@ -142,15 +142,23 @@ static IWebBrowser2 *create_ie_window(LPCSTR cmdline)
     }else {
         VARIANT var_url;
         DWORD len;
+        int cmdlen;
 
         if(!strncasecmp(cmdline, "-nohome", 7))
             cmdline += 7;
+        while(*cmdline == ' ' || *cmdline == '\t')
+            cmdline++;
+        cmdlen = lstrlenA(cmdline);
+        if(cmdlen > 2 && cmdline[0] == '"' && cmdline[cmdlen-1] == '"') {
+            cmdline++;
+            cmdlen -= 2;
+        }
 
         V_VT(&var_url) = VT_BSTR;
 
-        len = MultiByteToWideChar(CP_ACP, 0, cmdline, -1, NULL, 0);
+        len = MultiByteToWideChar(CP_ACP, 0, cmdline, cmdlen, NULL, 0);
         V_BSTR(&var_url) = SysAllocStringLen(NULL, len);
-        MultiByteToWideChar(CP_ACP, 0, cmdline, -1, V_BSTR(&var_url), len);
+        MultiByteToWideChar(CP_ACP, 0, cmdline, cmdlen, V_BSTR(&var_url), len);
 
         /* navigate to the first page */
         IWebBrowser2_Navigate2(wb, &var_url, NULL, NULL, NULL, NULL);




More information about the wine-cvs mailing list