Skip to content

Commit

Permalink
Simplify and unify environment usage in CUtil::GetHomePath
Browse files Browse the repository at this point in the history
  • Loading branch information
Karlson2k committed Jun 1, 2013
1 parent c84b505 commit 412d71d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions xbmc/Util.cpp
Expand Up @@ -86,6 +86,7 @@
#include "utils/TimeUtils.h"
#include "utils/URIUtils.h"
#include "utils/log.h"
#include "utils/Environment.h"

#include "cores/dvdplayer/DVDSubtitles/DVDSubtitleTagSami.h"
#include "cores/dvdplayer/DVDSubtitles/DVDSubtitleStream.h"
Expand Down Expand Up @@ -391,16 +392,9 @@ void CUtil::GetHomePath(CStdString& strPath, const CStdString& strTarget)
{
CStdString strHomePath;
strHomePath = ResolveExecutablePath();
#ifdef _WIN32
CStdStringW strPathW, strTargetW;
g_charsetConverter.utf8ToW(strTarget, strTargetW);
strPathW = _wgetenv(strTargetW);
g_charsetConverter.wToUTF8(strPathW,strPath);
#else
strPath = getenv(strTarget);
#endif
strPath = CEnvironment::getenv(strTarget);

if (strPath != NULL && !strPath.IsEmpty())
if (!strPath.IsEmpty())
{
#ifdef _WIN32
char tmp[1024];
Expand Down

0 comments on commit 412d71d

Please sign in to comment.