diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2016-03-28 22:02:41 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2016-03-29 10:04:52 +0000 |
commit | 017a864caf4c57f1dcff28fce824f2a41ea6e027 (patch) | |
tree | 5131b52e2d167cb7f173db4ae0c99a550b51922f /framework | |
parent | 33482731bf0dc8736112f703f14a059231091670 (diff) |
handle failure to expand ~ in path elements.
This can occur in some online corner-cases.
Change-Id: Id8b419179d775a21110d682ba76d8a02f45eb828
Reviewed-on: https://gerrit.libreoffice.org/23577
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/services/substitutepathvars.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index 17375a4de32b..3827e3233247 100644 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -822,9 +822,8 @@ OUString SubstitutePathVariables::GetHomeVariableValue() const OUString SubstitutePathVariables::GetPathVariableValue() const { - OUString aRetStr; - const char* pEnv = getenv( "PATH" ); + const char* pEnv = getenv( "PATH" ); if ( pEnv ) { @@ -838,9 +837,10 @@ OUString SubstitutePathVariables::GetPathVariableValue() const do { OUString sToken = aPathList.getToken(0, SAL_PATHSEPARATOR, nToken); - if (!sToken.isEmpty()) + if (!sToken.isEmpty() && + osl::FileBase::getFileURLFromSystemPath( sToken, aTmp ) == + osl::FileBase::RC::E_None ) { - osl::FileBase::getFileURLFromSystemPath( sToken, aTmp ); if ( bAppendSep ) aPathStrBuffer.append( ";" ); // Office uses ';' as path separator aPathStrBuffer.append( aTmp ); |