diff --git a/indra/llvfs/lldir_linux.cpp b/indra/llvfs/lldir_linux.cpp
index ae25ab2f2192846e8967eb285bb2615d4bcc7090..72b54f538083c5937012865572526c1b8afca0b6 100644
--- a/indra/llvfs/lldir_linux.cpp
+++ b/indra/llvfs/lldir_linux.cpp
@@ -93,7 +93,7 @@ LLDir_Linux::LLDir_Linux()
 #else
 	mAppRODataDir = tmp_str;
 #endif
-    std::string::size_type build_dir_pos = mExecutableDir.find("/build-linux-");
+    std::string::size_type build_dir_pos = mExecutableDir.rfind("/build-linux-");
     if (build_dir_pos != std::string::npos)
     {
 		// ...we're in a dev checkout
diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp
index e862ef0d84dd5466b703f11b9c68cfe63974584f..f9369b043eb47e4583dd88af6c737871f9bf9bea 100644
--- a/indra/llvfs/lldir_mac.cpp
+++ b/indra/llvfs/lldir_mac.cpp
@@ -150,7 +150,7 @@ LLDir_Mac::LLDir_Mac()
 		CFURLRef resourcesURLRef = CFBundleCopyResourcesDirectoryURL(mainBundleRef);
 		CFURLRefToLLString(resourcesURLRef, mAppRODataDir, true);
 		
-		U32 build_dir_pos = mExecutableDir.find("/build-darwin-");
+		U32 build_dir_pos = mExecutableDir.rfind("/build-darwin-");
 		if (build_dir_pos != std::string::npos)
 		{
 			// ...we're in a dev checkout