summaryrefslogtreecommitdiff
path: root/indra/llvfs/lldir_win32.cpp
diff options
context:
space:
mode:
authorMark Palange (Mani) <palange@lindenlab.com>2009-10-16 16:42:45 -0700
committerMark Palange (Mani) <palange@lindenlab.com>2009-10-16 16:42:45 -0700
commit3e10fa4d51a23bf6f1ced23e8d90c636d84fa5db (patch)
treed4991e4c1a9dd934f48d33804e55eb8ffa085679 /indra/llvfs/lldir_win32.cpp
parente9f7205ba9f4dfb3422759218609b62d61972722 (diff)
parentf20e9521a9b70f4e83cbb6888feae08a70681ea7 (diff)
merge from latest svn/viewer-2-0 to hg/viewer-2-0
Diffstat (limited to 'indra/llvfs/lldir_win32.cpp')
-rw-r--r--indra/llvfs/lldir_win32.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp
index 3e302764de..4c376f11a5 100644
--- a/indra/llvfs/lldir_win32.cpp
+++ b/indra/llvfs/lldir_win32.cpp
@@ -121,17 +121,22 @@ LLDir_Win32::LLDir_Win32()
GetCurrentDirectory(MAX_PATH, w_str);
mExecutableDir = utf16str_to_utf8str(llutf16string(w_str));
#endif
-
- // When running in a dev tree, app_settings is under indra/newview/
- // but in production it is under Program Files/SecondLife/
- // Attempt to detect which one we're using. JC
- if (mExecutableDir.find("indra") != std::string::npos)
- mAppRODataDir = getCurPath();
- else
- mAppRODataDir = mExecutableDir;
+
+ mAppRODataDir = ".";
mSkinBaseDir = mAppRODataDir + mDirDelimiter + "skins";
+ if (mExecutableDir.find("indra") == std::string::npos)
+ {
+ // Running from installed directory. Make sure current
+ // directory isn't something crazy (e.g. if invoking from
+ // command line).
+ SetCurrentDirectory(utf8str_to_utf16str(mExecutableDir).c_str());
+ GetCurrentDirectory(MAX_PATH, w_str);
+ mWorkingDir = utf16str_to_utf8str(llutf16string(w_str));
+ }
+ llinfos << "mAppRODataDir = " << mAppRODataDir << llendl;
+
// Build the default cache directory
mDefaultCacheDir = buildSLOSCacheDir();