Fix DOSFS_FindNextEx

György 'Nog' Jeney nog at sdf.lonestar.org
Fri Sep 27 12:19:34 CDT 2002


This patches fixes the DOSFS_FindNextEx function not to fail when
long_mask is
an empty string.  There is sill a problem with INT21_FindNext which some dos
apps still think fails but I don't know how they check becuase all the
related
functions return without error and the Carry flag isn't set.  Does anyone
have
a short example of how to use these functions and the DTA so I can fix this
bug?

ChangeLog:
 * file/dos_fs.c
   Check for an empty string in DOSFS_FindNextEx to avoid an unessecary
   failure.

nog.

-------------- next part --------------
Index: files/dos_fs.c
===================================================================
RCS file: /home/wine/wine/files/dos_fs.c,v
retrieving revision 1.120
diff -u -r1.120 dos_fs.c
--- files/dos_fs.c	16 Sep 2002 19:27:15 -0000	1.120
+++ files/dos_fs.c	27 Sep 2002 17:11:09 -0000
@@ -197,6 +197,8 @@
     LPCWSTR p = name;
     int i;
 
+    TRACE("(%s, %p)\n", debugstr_w(name), buffer);
+
     /* Check for "." and ".." */
     if (*p == '.')
     {
@@ -342,6 +344,8 @@
     LPCWSTR next_to_retry = NULL;
     static const WCHAR asterisk_dot_asterisk[] = {'*','.','*',0};
 
+    TRACE("(%s, %s, %x)\n", debugstr_w(mask), debugstr_w(name), case_sensitive);
+
     if (!strcmpW( mask, asterisk_dot_asterisk )) return 1;
     while (*name && *mask)
     {
@@ -605,6 +609,9 @@
         *short_name = NULL;
     dir->used += (strlenW(sn) + 1) * sizeof(WCHAR);
 
+    TRACE("Read: long_name: %s, short_name: %s\n", 
+          debugstr_w(*long_name), debugstr_w(*short_name));
+
     return TRUE;
 }
 
@@ -1736,7 +1743,7 @@
 
         /* Check the long mask */
 
-        if (info->long_mask)
+        if (info->long_mask && *info->long_mask)
         {
             if (!DOSFS_MatchLong( info->long_mask, long_name,
                                   flags & DRIVE_CASE_SENSITIVE )) continue;
@@ -1823,6 +1830,10 @@
     int count;
     UNICODE_STRING short_maskW, long_maskW;
     WIN32_FIND_DATAW entryW;
+
+    TRACE("(%s, %s, %s, %x, %x, %x, %p)\n", debugstr_a(path),
+          debugstr_a(short_mask), debugstr_a(long_mask), drive, attr, skip,
+          entry);
 
     _EnterWin16Lock();
 



More information about the wine-patches mailing list