From 25932dc723f1a46ab6f6fd73f56e4ad43000c5c3 Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 26 Jan 2014 17:08:01 -0800 Subject: [PATCH] cmFileSys.h : cmFileSysVMakeFn() can now work with no 'fn' arg. --- cmFileSys.c | 18 +++++++++--------- cmFileSys.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmFileSys.c b/cmFileSys.c index 9a96583..470c463 100644 --- a/cmFileSys.c +++ b/cmFileSys.c @@ -378,14 +378,13 @@ const cmChar_t* cmFileSysVMakeFn( cmFileSysH_t h, const cmChar_t* dir, const cmC va_list vl_t; va_copy(vl_t,vl); - assert( fn != NULL ); - // get prefix directory length if( dir != NULL ) n += strlen(dir) + 1; // add 1 for ending sep // get file name length - n += strlen(fn); + if( fn != NULL ) + n += strlen(fn); // get extension length 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 - if(!_cmFileSysConcat(rp,n,pathSep,fn)) - { - assert(0); - rc = _cmFileSysError(p,kAssertFailFsRC,0,"Assert failed."); - goto errLabel; - } + if( fn != NULL ) + if(!_cmFileSysConcat(rp,n,pathSep,fn)) + { + assert(0); + rc = _cmFileSysError(p,kAssertFailFsRC,0,"Assert failed."); + goto errLabel; + } // copy out the extension if( ext != NULL ) diff --git a/cmFileSys.h b/cmFileSys.h index e67dca9..073b1f2 100644 --- a/cmFileSys.h +++ b/cmFileSys.h @@ -35,7 +35,7 @@ extern "C" { kOsxFailFsRC, kLinuxFailFsRC, kInvalidDirFsRC, - kGenFileFailFsRC + kGenFileFailFsRC, };