[PATCH 1/4] shell32/tests: tmpdir shouldn't end with a backslash

Damjan Jovanovic damjan.jov at gmail.com
Sun Mar 22 06:46:12 CDT 2020


GetTempPathA() returns backslash-terminated paths,
but all the test code appends its own additional backslash,
making a double backslash that breaks path comparisons
in my later patches. Fix this.

Signed-off-by: Damjan Jovanovic <damjan.jov at gmail.com>
---
 dlls/shell32/tests/shlexec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
-------------- next part --------------
diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index f6f384bbe0..5d074671c5 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -2690,9 +2690,12 @@ static void init_test(void)
     /* Older versions (win 2k) fail tests if there is a space in
        the path. */
     if (dllver.dwMajorVersion <= 5)
-        strcpy(filename, "c:\\");
+        strcpy(filename, "c:");
     else
+    {
         GetTempPathA(sizeof(filename), filename);
+        filename[strlen(filename)-1] = '\0';
+    }
 
     /* In case of a failure it is necessary to show the path that was passed to
      * ShellExecute(). That means the paths must not be randomized so as not to


More information about the wine-devel mailing list