Reflecting changes in crtdll.

svn path=/trunk/; revision=1659
This commit is contained in:
Carl Nettelblad 2001-03-03 13:28:28 +00:00
parent afe0e9f601
commit d5d8d819b8

View file

@ -5,16 +5,18 @@ void _makepath( char *path, const char *drive, const char *dir, const char *fnam
{ {
int dir_len; int dir_len;
if ( drive != NULL ) { if ( drive != NULL ) {
strcat(path,drive); strcpy(path,drive);
strcat(path,":"); strcat(path,":");
} }
else
(*path)=0;
if ( dir != NULL ) { if ( dir != NULL ) {
strcat(path,dir); strcat(path,dir);
if ( *dir != '\\' ) if ( *dir != '\\' )
strcat(path,"\\"); strcat(path,"\\");
dir_len = strlen(dir); dir_len = strlen(dir);
if ( *(dir + dir_len - 1) != '\\' ) if (dir_len && *(dir + dir_len - 1) != '\\' )
strcat(path,"\\"); strcat(path,"\\");
} }
if ( fname != NULL ) { if ( fname != NULL ) {
@ -31,16 +33,18 @@ void _wmakepath( wchar_t *path, const wchar_t *drive, const wchar_t *dir, const
{ {
int dir_len; int dir_len;
if ( drive != NULL ) { if ( drive != NULL ) {
wcscat(path,drive); wcscpy(path,drive);
wcscat(path,L":"); wcscat(path,L":");
} }
else
(*path)=0;
if ( dir != NULL ) { if ( dir != NULL ) {
wcscat(path,dir); wcscat(path,dir);
if ( *dir != L'\\' ) if ( *dir != L'\\' )
wcscat(path,L"\\"); wcscat(path,L"\\");
dir_len = wcslen(dir); dir_len = wcslen(dir);
if ( *(dir + dir_len - 1) != L'\\' ) if ( dir_len && *(dir + dir_len - 1) != L'\\' )
wcscat(path,L"\\"); wcscat(path,L"\\");
} }
if ( fname != NULL ) { if ( fname != NULL ) {