mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Additional fixes.
svn path=/trunk/; revision=1661
This commit is contained in:
parent
2ec9eaf736
commit
de10767975
4 changed files with 27 additions and 13 deletions
|
@ -4,7 +4,7 @@
|
|||
void _makepath( char *path, const char *drive, const char *dir, const char *fname, const char *ext )
|
||||
{
|
||||
int dir_len;
|
||||
if ( drive != NULL ) {
|
||||
if ( drive != NULL && (*drive)) {
|
||||
strcpy(path,drive);
|
||||
strcat(path,":");
|
||||
}
|
||||
|
@ -27,6 +27,4 @@ void _makepath( char *path, const char *drive, const char *dir, const char *fnam
|
|||
strcat(path,ext);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -30,13 +30,18 @@ void _splitpath( const char *path, char *drive, char *dir, char *fname, char *ex
|
|||
strcpy(ext,tmp_ext);
|
||||
}
|
||||
else
|
||||
{
|
||||
*ext = 0;
|
||||
tmp_ext = path+strlen(path);
|
||||
}
|
||||
if ( tmp_dir != NULL ) {
|
||||
strncpy(fname,tmp_dir+1,tmp_ext - tmp_dir - 1);
|
||||
*(fname + (tmp_ext - tmp_dir -1)) = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(fname,path,tmp_ext - path);
|
||||
|
||||
*(fname+(tmp_ext-path))=0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
void _makepath( char *path, const char *drive, const char *dir, const char *fname, const char *ext )
|
||||
{
|
||||
int dir_len;
|
||||
if ( drive != NULL ) {
|
||||
if ( drive != NULL && (*drive)) {
|
||||
strcpy(path,drive);
|
||||
strcat(path,":");
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ void _makepath( char *path, const char *drive, const char *dir, const char *fnam
|
|||
void _wmakepath( wchar_t *path, const wchar_t *drive, const wchar_t *dir, const wchar_t *fname, const wchar_t *ext )
|
||||
{
|
||||
int dir_len;
|
||||
if ( drive != NULL ) {
|
||||
if ( drive != NULL && (*drive)) {
|
||||
wcscpy(path,drive);
|
||||
wcscat(path,L":");
|
||||
}
|
||||
|
|
|
@ -30,14 +30,19 @@ void _splitpath( const char *path, char *drive, char *dir, char *fname, char *ex
|
|||
strcpy(ext,tmp_ext);
|
||||
}
|
||||
else
|
||||
{
|
||||
*ext = 0;
|
||||
|
||||
tmp_ext = path+strlen(path);
|
||||
}
|
||||
if ( tmp_dir != NULL ) {
|
||||
strncpy(fname,tmp_dir+1,tmp_ext - tmp_dir - 1);
|
||||
*(fname + (tmp_ext - tmp_dir -1)) = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(fname,path,tmp_ext - path);
|
||||
*(fname+(tmp_ext-path))=0;
|
||||
}
|
||||
}
|
||||
|
||||
void _wsplitpath( const wchar_t *path, wchar_t *drive, wchar_t *dir, wchar_t *fname, wchar_t *ext )
|
||||
|
@ -69,12 +74,18 @@ void _wsplitpath( const wchar_t *path, wchar_t *drive, wchar_t *dir, wchar_t *fn
|
|||
wcscpy(ext,tmp_ext);
|
||||
}
|
||||
else
|
||||
{
|
||||
*ext = 0;
|
||||
tmp_ext = path+wcslen(path);
|
||||
}
|
||||
|
||||
if ( tmp_dir != NULL ) {
|
||||
wcsncpy(fname,tmp_dir+1,tmp_ext - tmp_dir - 1);
|
||||
*(fname + (tmp_ext - tmp_dir -1)) = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
wcsncpy(fname,path,tmp_ext - path);
|
||||
*(fname+(tmp_ext-path))=0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue