mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
fixed little bug in FindFirstFile()
svn path=/trunk/; revision=408
This commit is contained in:
parent
321081bb62
commit
54378dbf2a
1 changed files with 15 additions and 21 deletions
|
@ -112,19 +112,11 @@ HANDLE STDCALL InternalFindFirstFile(LPCWSTR lpFileName,
|
|||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
UNICODE_STRING DirectoryNameStr;
|
||||
IO_STATUS_BLOCK IoStatusBlock;
|
||||
DWORD Len = 0;
|
||||
// DWORD Len = 0;
|
||||
|
||||
DPRINT("FindFirstFileW(lpFileName %w, lpFindFileData %x)\n",
|
||||
lpFileName, lpFindFileData);
|
||||
lpFileName, lpFindFileData);
|
||||
|
||||
/*
|
||||
Len = GetCurrentDirectoryW(MAX_PATH, CurrentDirectory);
|
||||
if (CurrentDirectory[Len - 1] != L'\\')
|
||||
{
|
||||
CurrentDirectory[Len] = L'\\';
|
||||
CurrentDirectory[Len + 1] = 0;
|
||||
}
|
||||
*/
|
||||
GetFullPathNameW(lpFileName, MAX_PATH, CurrentDirectory, NULL);
|
||||
Directory[0] = '\\';
|
||||
Directory[1] = '?';
|
||||
|
@ -134,8 +126,6 @@ HANDLE STDCALL InternalFindFirstFile(LPCWSTR lpFileName,
|
|||
DPRINT("Directory %w\n",Directory);
|
||||
wcscat(Directory, CurrentDirectory);
|
||||
DPRINT("Directory %w\n",Directory);
|
||||
// wcscat(Directory, lpFileName);
|
||||
// DPRINT("Directory %w\n",Directory);
|
||||
End = wcsrchr(Directory, '\\');
|
||||
*End = 0;
|
||||
|
||||
|
@ -143,6 +133,10 @@ HANDLE STDCALL InternalFindFirstFile(LPCWSTR lpFileName,
|
|||
*(End+1) = 0;
|
||||
*End = '\\';
|
||||
|
||||
/* change pattern: "*.*" --> "*" */
|
||||
if (!wcscmp(Pattern, L"*.*"))
|
||||
Pattern[1] = 0;
|
||||
|
||||
DPRINT("Directory %w Pattern %w\n",Directory,Pattern);
|
||||
|
||||
IData = HeapAlloc(GetProcessHeap(),
|
||||
|
|
Loading…
Reference in a new issue