SHELL32/tests: remove trailing backslash

Saulius Krasuckas saulius2 at ar.fi.lt
Mon Aug 8 12:15:01 CDT 2005


When not removed, it makes some functions to fail on win9x and others to 
lag (which causes some shell32 tests to time out).  This is the case when 
Working Directory of Winetest*.exe is a root folder of a drive.


Log message:
        Saulius Krasuckas <saulius.krasuckas at ieee.org>
        Remove trailing backslash


Index: dlls/shell32/tests/shlfileop.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/tests/shlfileop.c,v
retrieving revision 1.20
diff -p -u -r1.20 shlfileop.c
--- dlls/shell32/tests/shlfileop.c      20 Jun 2005 10:30:15 -0000      1.20
+++ dlls/shell32/tests/shlfileop.c      8 Aug 2005 14:59:55 -0000
@@ -64,7 +64,14 @@ static BOOL file_exists(const CHAR *name
 /* initializes the tests */
 static void init_shfo_tests(void)
 {
+    int len;
+
     GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
+    len = lstrlenA(CURR_DIR);
+
+    if(len && (CURR_DIR[len-1] == '\\'))
+        CURR_DIR[len-1] = 0;
+
     createTestFile(".\\test1.txt");
     createTestFile(".\\test2.txt");
     createTestFile(".\\test3.txt");
Index: dlls/shell32/tests/shlfolder.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/tests/shlfolder.c,v
retrieving revision 1.26
diff -p -u -r1.26 shlfolder.c
--- dlls/shell32/tests/shlfolder.c      8 Aug 2005 11:04:30 -0000       1.26
+++ dlls/shell32/tests/shlfolder.c      8 Aug 2005 14:59:56 -0000
@@ -621,9 +621,19 @@ static void test_EnumObjects_and_Compare
     char  cCurrDirA [MAX_PATH] = {0};
     WCHAR cCurrDirW [MAX_PATH];
     static const WCHAR cTestDirW[] = {'\\','t','e','s','t','d','i','r',0};
+    int len;
     HRESULT hr;
 
     GetCurrentDirectoryA(MAX_PATH, cCurrDirA);
+    len = lstrlenA(cCurrDirA);
+
+    if(len == 0) {
+        trace("GetCurrentDirectoryA returned empty string. Skipping test_EnumObjects_and_CompareIDs\n");
+        return;
+    }
+    if(cCurrDirA[len-1] == '\\')
+        cCurrDirA[len-1] = 0;
+
     MultiByteToWideChar(CP_ACP, 0, cCurrDirA, -1, cCurrDirW, MAX_PATH);
     strcatW(cCurrDirW, cTestDirW);
 




More information about the wine-patches mailing list