cmFileSys.h : cmFileSysVMakeFn() can now work with no 'fn' arg.
This commit is contained in:
parent
92a9b18f44
commit
25932dc723
18
cmFileSys.c
18
cmFileSys.c
@ -378,14 +378,13 @@ const cmChar_t* cmFileSysVMakeFn( cmFileSysH_t h, const cmChar_t* dir, const cmC
|
|||||||
va_list vl_t;
|
va_list vl_t;
|
||||||
va_copy(vl_t,vl);
|
va_copy(vl_t,vl);
|
||||||
|
|
||||||
assert( fn != NULL );
|
|
||||||
|
|
||||||
// get prefix directory length
|
// get prefix directory length
|
||||||
if( dir != NULL )
|
if( dir != NULL )
|
||||||
n += strlen(dir) + 1; // add 1 for ending sep
|
n += strlen(dir) + 1; // add 1 for ending sep
|
||||||
|
|
||||||
// get file name length
|
// get file name length
|
||||||
n += strlen(fn);
|
if( fn != NULL )
|
||||||
|
n += strlen(fn);
|
||||||
|
|
||||||
// get extension length
|
// get extension length
|
||||||
if( ext != NULL )
|
if( ext != NULL )
|
||||||
@ -423,12 +422,13 @@ const cmChar_t* cmFileSysVMakeFn( cmFileSysH_t h, const cmChar_t* dir, const cmC
|
|||||||
|
|
||||||
|
|
||||||
// copy out the file name
|
// copy out the file name
|
||||||
if(!_cmFileSysConcat(rp,n,pathSep,fn))
|
if( fn != NULL )
|
||||||
{
|
if(!_cmFileSysConcat(rp,n,pathSep,fn))
|
||||||
assert(0);
|
{
|
||||||
rc = _cmFileSysError(p,kAssertFailFsRC,0,"Assert failed.");
|
assert(0);
|
||||||
goto errLabel;
|
rc = _cmFileSysError(p,kAssertFailFsRC,0,"Assert failed.");
|
||||||
}
|
goto errLabel;
|
||||||
|
}
|
||||||
|
|
||||||
// copy out the extension
|
// copy out the extension
|
||||||
if( ext != NULL )
|
if( ext != NULL )
|
||||||
|
@ -35,7 +35,7 @@ extern "C" {
|
|||||||
kOsxFailFsRC,
|
kOsxFailFsRC,
|
||||||
kLinuxFailFsRC,
|
kLinuxFailFsRC,
|
||||||
kInvalidDirFsRC,
|
kInvalidDirFsRC,
|
||||||
kGenFileFailFsRC
|
kGenFileFailFsRC,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user