[PATCH] explorer: Take spaces into account when returning string length

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Mon Dec 11 17:13:55 CST 2017


Fixes: https://bugs.winehq.org/show_bug.cgi?id=44153

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 programs/explorer/explorer.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/programs/explorer/explorer.c b/programs/explorer/explorer.c
index afb565f..59dc84d 100644
--- a/programs/explorer/explorer.c
+++ b/programs/explorer/explorer.c
@@ -660,9 +660,13 @@ static IShellFolder* get_starting_shell_folder(parameters_struct* params)
 
 static int copy_path_string(LPWSTR target, LPWSTR source)
 {
-    INT i = 0;
+    INT i = 0, spaces = 0;
 
-    while (isspaceW(*source)) source++;
+    while (isspaceW(*source))
+    {
+        source++;
+        spaces++;
+    }
 
     if (*source == '\"')
     {
@@ -678,7 +682,7 @@ static int copy_path_string(LPWSTR target, LPWSTR source)
         target[i] = 0;
     }
     PathRemoveBackslashW(target);
-    return i;
+    return i+ spaces;
 }
 
 
-- 
1.9.1




More information about the wine-devel mailing list