[PATCH 3/3] shell32/tests: Test that quoting file path prevents masking at space.

Ken Thomases ken at codeweavers.com
Tue Apr 17 08:21:06 CDT 2007


---
  dlls/shell32/tests/shlexec.c |   13 ++++++++++++-
  1 files changed, 12 insertions(+), 1 deletions(-)
-------------- next part --------------
diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index af07de0..a226667 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -521,6 +521,8 @@ static filename_tests_t filename_tests[]=
 
     /* Test file masked due to space */
     {NULL,           "%s\\masked file.shlexec",   0x1, 33},
+    /* Test if quoting prevents the masking */
+    {NULL,           "%s\\masked file.shlexec",   0x40, 33},
 
     {NULL, NULL, 0}
 };
@@ -556,7 +558,16 @@ static void test_filename(void)
                 c++;
             }
         }
-        rc=shell_execute(test->verb, filename, NULL, NULL);
+        if ((test->todo & 0x40)==0)
+        {
+            rc=shell_execute(test->verb, filename, NULL, NULL);
+        }
+        else
+        {
+            char quoted[MAX_PATH + 2];
+            sprintf(quoted, "\"%s\"", filename);
+            rc=shell_execute(test->verb, quoted, NULL, NULL);
+        }
         if (rc > 32)
             rc=33;
         if ((test->todo & 0x1)==0)


More information about the wine-patches mailing list