diff options
author | wtc%google.com <devnull@localhost> | 2009-02-05 05:41:16 +0000 |
---|---|---|
committer | wtc%google.com <devnull@localhost> | 2009-02-05 05:41:16 +0000 |
commit | 1acec4baca51b83df6ef4c70c3be66f0456fd934 (patch) | |
tree | bff40bf5ec04ab24d4d0e3f0d91f8569cfc4798b | |
parent | 96a8ddded2cedf08b564f8b11a0c68aa180d7d53 (diff) | |
download | nss-hg-1acec4baca51b83df6ef4c70c3be66f0456fd934.tar.gz |
Bug 466745: Use <> instead of "" for the system header shlobj.h. Changed
EnumSystemFilesInFolder to recurse into directories. The patch is
contributed by Brad Lassey <bugmail@lassey.us>. r=wtc.
-rw-r--r-- | security/nss/lib/freebl/win_rand.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/security/nss/lib/freebl/win_rand.c b/security/nss/lib/freebl/win_rand.c index 9df36aca6..9dfddc309 100644 --- a/security/nss/lib/freebl/win_rand.c +++ b/security/nss/lib/freebl/win_rand.c @@ -39,7 +39,7 @@ #ifdef XP_WIN #include <windows.h> -#include "shlobj.h" /* for CSIDL constants */ +#include <shlobj.h> /* for CSIDL constants */ #if defined(_WIN32_WCE) #include <stdlib.h> /* Win CE puts lots of stuff here. */ @@ -149,9 +149,13 @@ EnumSystemFilesInFolder(PRInt32 (*func)(const char *), PRUnichar* szSysDir) { do { // pass the full pathname to the callback _snwprintf(szFileName,_MAX_PATH, L"%s\\%s", szSysDir, fdData.cFileName); - WideCharToMultiByte(CP_ACP, 0, szFileName, -1, - narrowFileName,_MAX_PATH,0,0); - (*func)(narrowFileName); + if (fdData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + EnumSystemFilesInFolder(func, szFileName); + } else { + WideCharToMultiByte(CP_ACP, 0, szFileName, -1, + narrowFileName,_MAX_PATH,0,0); + (*func)(narrowFileName); + } iStatus = FindNextFileW(lFindHandle, &fdData); } while (iStatus != 0); FindClose(lFindHandle); |