diff options
| author | Nat Goodspeed <nat@lindenlab.com> | 2012-03-14 23:59:57 -0400 | 
|---|---|---|
| committer | Nat Goodspeed <nat@lindenlab.com> | 2012-03-14 23:59:57 -0400 | 
| commit | 7de3161fa866bc415b4b87f26ca3f7fc3670af78 (patch) | |
| tree | a1e63d8c4030fe5f1a503837a7f4612ee06f42b4 | |
| parent | cb38ceb89fc34105ad2ba2fdfa35faa2918d0346 (diff) | |
Fix --leap assumption that LeapCommand setting is ALWAYS an array.
Nuance of command-line processing: when there's exactly one --leap switch, the
resulting LLSD is a scalar string rather than an array with one entry. Fix
processing code to handle either case.
| -rw-r--r-- | indra/newview/llappviewer.cpp | 17 | 
1 files changed, 14 insertions, 3 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 85bd836104..7e0162d026 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1041,10 +1041,21 @@ bool LLAppViewer::init()  	gGLActive = FALSE; -	// Iterate over --leap command-line options -	BOOST_FOREACH(const std::string& leap, llsd::inArray(gSavedSettings.getLLSD("LeapCommand"))) +	// Iterate over --leap command-line options. But this is a bit tricky: if +	// there's only one, it won't be an array at all. +	LLSD LeapCommand(gSavedSettings.getLLSD("LeapCommand")); +	LL_DEBUGS("InitInfo") << "LeapCommand: " << LeapCommand << LL_ENDL; +	if (LeapCommand.isDefined() && ! LeapCommand.isArray())  	{ -		LL_DEBUGS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL; +		// If LeapCommand is actually a scalar value, make an array of it. +		// Have to do it in two steps because LeapCommand.append(LeapCommand) +		// trashes content! :-P +		LLSD item(LeapCommand); +		LeapCommand.append(item); +	} +	BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand)) +	{ +		LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL;  		// We don't have any better description of this plugin than the  		// user-specified command line. Passing "" causes LLLeap to derive a  		// description from the command line itself.  | 
