/* get path and filenames */
SHGetPathFromIDListW(fodInfos->ShellInfos.pidlAbsCurrent,lpstrCurrentDir);
- n = FILEDLG95_FILENAME_GetFileNames(hwnd, &lpstrFileList, &sizeUsed);
+ n = FILEDLG95_FILENAME_GetFileNames(hwnd, &lpstrFileList, &sizeUsed, ' ');
TRACE("path >%s< filespec >%s< %d files\n",
debugstr_w(lpstrCurrentDir),debugstr_w(lpstrFileList),n);
TRACE("CDM_GETSPEC:\n");
- FILEDLG95_FILENAME_GetFileNames(hwnd, &lpstrFileList, &sizeUsed);
+ FILEDLG95_FILENAME_GetFileNames(hwnd, &lpstrFileList, &sizeUsed, ' ');
if( fodInfos->unicode )
{
LPWSTR bufW = buffer;
TRACE("hwnd=%p\n", hwnd);
/* get the files from the edit control */
- nFileCount = FILEDLG95_FILENAME_GetFileNames(hwnd, &lpstrFileList, &sizeUsed);
+ nFileCount = FILEDLG95_FILENAME_GetFileNames(hwnd, &lpstrFileList, &sizeUsed, '\0');
/* try if the user selected a folder in the shellview */
if(nFileCount == 0)
/***********************************************************************
* FILEDLG95_FILENAME_GetFileNames
*
- * copies the filenames to a 0-delimited string list (A\0B\0C\0\0)
+ * Copies the filenames to a delimited string list.
+ * The delimiter is specified by the parameter 'separator',
+ * usually either a space or a nul
*/
-int FILEDLG95_FILENAME_GetFileNames (HWND hwnd, LPWSTR * lpstrFileList, UINT * sizeUsed)
+int FILEDLG95_FILENAME_GetFileNames (HWND hwnd, LPWSTR * lpstrFileList, UINT * sizeUsed, char separator)
{
FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr);
UINT nStrCharCount = 0; /* index in src buffer */
*lpstrFileList = MemAlloc( (nStrLen+2)*sizeof(WCHAR) );
*sizeUsed = 0;
- /* build 0-delimited file list from filenames */
+ /* build delimited file list from filenames */
while ( nStrCharCount <= nStrLen )
{
if ( lpstrEdit[nStrCharCount]=='"' )
(*sizeUsed)++;
nStrCharCount++;
}
- (*lpstrFileList)[nFileIndex++] = '\0';
+ (*lpstrFileList)[nFileIndex++] = separator;
(*sizeUsed)++;
nFileCount++;
}