Listview FindInfoA fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ChangeLog
  Avoid converting nonexistent text from A->W.
  Found (and fixed) by Gerard Patel <gerard.patel@nerim.net>

--
Dimi.
Index: dlls/comctl32/listview.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/listview.c,v
retrieving revision 1.108
diff -u -r1.108 listview.c
--- dlls/comctl32/listview.c	18 Jan 2002 19:05:35 -0000	1.108
+++ dlls/comctl32/listview.c	26 Jan 2002 05:49:07 -0000
@@ -4583,13 +4583,14 @@
 static LRESULT LISTVIEW_FindItemA(HWND hwnd, INT nStart, 
                                   LPLVFINDINFOA lpFindInfo)
 {
+  BOOL hasText = lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL);
   LVFINDINFOW fiw;
   LRESULT res;
   
   memcpy(&fiw, lpFindInfo, sizeof(fiw));
-  fiw.psz = textdupTtoW((LPCWSTR)lpFindInfo->psz, FALSE);
+  if (hasText) fiw.psz = textdupTtoW((LPCWSTR)lpFindInfo->psz, FALSE);
   res = LISTVIEW_FindItemW(hwnd, nStart, &fiw);
-  textfreeT((LPWSTR)fiw.psz, FALSE);
+  if (hasText) textfreeT((LPWSTR)fiw.psz, FALSE);
   return res;
 }
 

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux