SHELL32/tests: trim extraneous backslash

Saulius Krasuckas saulius2 at ar.fi.lt
Wed Jun 15 08:34:40 CDT 2005


When tests starts in lets say 'C:\', some SHELL32 functions are passed 
'C:\\testdir'.  Then some f-ns fail, while other start lagging horribly.

ChangeLog:
        Saulius Krasuckas <saulius.krasuckas at ieee.org>
        Trim backslash when current dir is a root of the drive.


Index: dlls/shell32/tests/shlfileop.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/tests/shlfileop.c,v
retrieving revision 1.19
diff -w -p -u -r1.19 shlfileop.c
--- dlls/shell32/tests/shlfileop.c      1 Jun 2005 11:04:26 -0000       1.19
+++ dlls/shell32/tests/shlfileop.c      15 Jun 2005 13:29:48 -0000
@@ -64,7 +64,14 @@ BOOL file_exists(const CHAR *name)
 /* initializes the tests */
 void init_shfo_tests(void)
 {
+    char *tail;
+
+    /* shouldn't we cd to %TEMP% to don't leave 
+       trash in a case test caughts some exception? */
     GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
+    tail = CURR_DIR + lstrlenA(CURR_DIR) - 1;
+    if(*tail=='\\') *tail=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.12
diff -w -p -u -r1.12 shlfolder.c
--- dlls/shell32/tests/shlfolder.c      14 Jun 2005 19:18:26 -0000      1.12
+++ dlls/shell32/tests/shlfolder.c      15 Jun 2005 13:29:48 -0000
@@ -347,12 +347,15 @@ START_TEST(shlfolder)
 {
     ITEMIDLIST *newPIDL;
     IShellFolder *IDesktopFolder, *testIShellFolder;
+    char *tail;
     char  cCurrDirA [MAX_PATH] = {0};
     WCHAR cCurrDirW [MAX_PATH];
     static const WCHAR cTestDirW[] = {'\\','t','e','s','t','d','i','r',0};
     HRESULT hr;
     
     GetCurrentDirectoryA(MAX_PATH, cCurrDirA);
+    tail = cCurrDirA + lstrlenA(cCurrDirA) - 1;
+    if(*tail=='\\') *tail=0;
     MultiByteToWideChar(CP_ACP, 0, cCurrDirA, -1, cCurrDirW, MAX_PATH);
     strcatW(cCurrDirW, cTestDirW);
 



More information about the wine-patches mailing list