cwFileSystem.cpp : Fixed but in exapndPath() that rejected paths with spaces.
This commit is contained in:
parent
49d84eeb2e
commit
1232c3e36e
@ -4,6 +4,7 @@
|
||||
#include "cwFileSys.h"
|
||||
#include "cwCommonImpl.h"
|
||||
#include "cwMem.h"
|
||||
#include "cwString.h"
|
||||
|
||||
#ifdef OS_LINUX
|
||||
#include <libgen.h> // basename() dirname()
|
||||
@ -242,16 +243,19 @@ char* cw::filesys::expandPath( const char* dir )
|
||||
goto errLabel;
|
||||
}
|
||||
|
||||
if( res.we_wordc > 1 )
|
||||
switch( res.we_wordc )
|
||||
{
|
||||
rc = cwLogError(kOpFailRC,"Unexpected word expansion count: %i.", res.we_wordc );
|
||||
goto errLabel;
|
||||
}
|
||||
case 0:
|
||||
newDir = str::dupl(dir);
|
||||
break;
|
||||
|
||||
if( res.we_wordc == 1 )
|
||||
newDir = mem::duplStr(res.we_wordv[0]);
|
||||
else
|
||||
newDir = mem::duplStr(dir);
|
||||
case 1:
|
||||
newDir = str::dupl(res.we_wordv[0]);
|
||||
break;
|
||||
|
||||
default:
|
||||
newDir = str::join(" ", (const char**)res.we_wordv, res.we_wordc );
|
||||
}
|
||||
|
||||
errLabel:
|
||||
if( rc != kOkRC )
|
||||
|
Loading…
Reference in New Issue
Block a user