diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-08-18 11:14:45 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-08-18 11:14:45 +0000 |
commit | 31dae491cd680a72426cc5ad86ff6b251b35fa3f (patch) | |
tree | dcc03d4e669d98eef73bb52f20549bb28ac751e0 /sal | |
parent | 8c8d9102c5f102958976f4346b06e5e6ee3096eb (diff) |
INTEGRATION: CWS hrovista2 (1.18.30); FILE MERGED
2008/07/04 09:37:11 hro 1.18.30.1: #i77427# Allow opening a complete empty root directory
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/file.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx index 4e53cbeb0a70..cb104f7d95aa 100644 --- a/sal/osl/w32/file.cxx +++ b/sal/osl/w32/file.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: file.cxx,v $ - * $Revision: 1.18 $ + * $Revision: 1.19 $ * * This file is part of OpenOffice.org. * @@ -460,8 +460,11 @@ namespace /* private */ if (!IsValidHandle(pDirectory->hFind)) { - HeapFree(GetProcessHeap(), 0, pDirectory); - pDirectory = NULL; + if ( GetLastError() != ERROR_NO_MORE_FILES ) + { + HeapFree(GetProcessHeap(), 0, pDirectory); + pDirectory = NULL; + } } } return (HANDLE)pDirectory; @@ -504,8 +507,13 @@ namespace /* private */ fSuccess = TRUE; pDirectory->aFirstData.cFileName[0] = 0; } - else + else if ( IsValidHandle( pDirectory->hFind ) ) fSuccess = FindNextFile( pDirectory->hFind, pFindData ); + else + { + fSuccess = FALSE; + SetLastError( ERROR_NO_MORE_FILES ); + } fValid = fSuccess && _tcscmp( TEXT("."), pFindData->cFileName ) != 0 && _tcscmp( TEXT(".."), pFindData->cFileName ) != 0; |