Hello All:
I am not getting correct result from function _wmakepath. The following program demonstrate output from functions _makepath and _wmakepath.
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char path [FILENAME_MAX];
char drive[] = "C:";
char dir [] = "\\foldername\\";
char name [] = "filename";
char ext [] = "txt";
_makepath(path, drive, dir, name, ext);
printf("%s \n", path);
wchar_t wpath [FILENAME_MAX];
wchar_t wdrive[] = L"C:";
wchar_t wdir [] = L"\\foldername\\";
wchar_t wname [] = L"filename";
wchar_t wext [] = L"txt";
_wmakepath(wpath, wdrive, wdir, wname, wext);
printf("%ls \n", wpath);
return 0;
}
Output:
C:\foldername\filename.txt (from _makepath)
C:\foldername\ (from _wmakepath)
Output from _wmakepath is missing the filename and extension components.
Compiler options are: -std:C11 -Tx86-coff -Ot -Ob1 -fp:precise -W1 -Gd -Zx
Version: 8.00.60 (Win64)
TimoVJL produced a fix for this bug in
http://forum.pellesc.de/index.php?topic=7162.msg27173#msg27173Regards,