summaryrefslogtreecommitdiff
path: root/indra/llvfs/lldir.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-01-18 14:07:03 -0800
committerTofu Linden <tofu.linden@lindenlab.com>2010-01-18 14:07:03 -0800
commit66f5f2b922e21a1b7618a4038a5f53e3de97e4df (patch)
treedd81b3c4b9e3ec1b4d344af9325b019737f538f5 /indra/llvfs/lldir.cpp
parent48123c536c8ae182b39440163d7002a07d126e0c (diff)
EXT-4470 Several bad assumptions that LL_PATH_PER_SL_ACCOUNT is always good (which it isn't until after login)
To be reviewed by Soft!
Diffstat (limited to 'indra/llvfs/lldir.cpp')
-rw-r--r--indra/llvfs/lldir.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp
index b2b17fdd56..da4abde451 100644
--- a/indra/llvfs/lldir.cpp
+++ b/indra/llvfs/lldir.cpp
@@ -200,6 +200,11 @@ const std::string &LLDir::getOSUserAppDir() const
const std::string &LLDir::getLindenUserDir() const
{
+ if (mLindenUserDir.empty())
+ {
+ lldebugs << "getLindenUserDir() called early, we don't have the user name yet - returning empty string to caller" << llendl;
+ }
+
return mLindenUserDir;
}
@@ -337,7 +342,7 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd
break;
case LL_PATH_CACHE:
- prefix = getCacheDir();
+ prefix = getCacheDir();
break;
case LL_PATH_USER_SETTINGS:
@@ -348,6 +353,11 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd
case LL_PATH_PER_SL_ACCOUNT:
prefix = getLindenUserDir();
+ if (prefix.empty())
+ {
+ // if we're asking for the per-SL-account directory but we haven't logged in yet (or otherwise don't know the account name from which to build this string), then intentionally return a blank string to the caller and skip the below warning about a blank prefix.
+ return std::string();
+ }
break;
case LL_PATH_CHAT_LOGS:
@@ -557,7 +567,7 @@ std::string LLDir::getForbiddenFileChars()
void LLDir::setLindenUserDir(const std::string &first, const std::string &last)
{
- // if both first and last aren't set, assume we're grabbing the cached dir
+ // if both first and last aren't set, that's bad.
if (!first.empty() && !last.empty())
{
// some platforms have case-sensitive filesystems, so be
@@ -571,6 +581,7 @@ void LLDir::setLindenUserDir(const std::string &first, const std::string &last)
mLindenUserDir += firstlower;
mLindenUserDir += "_";
mLindenUserDir += lastlower;
+ llinfos << "Got name for LLDir::setLindenUserDir(first='" << first << "', last='" << last << "')" << llendl;
}
else
{