From d80422eba7a4c75f6947ab9186d652b0a31b845e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 10 Feb 2012 23:39:32 +0000 Subject: Add line numbers to Util.PrintCallStack() --- OpenSim/Framework/Util.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index ed92b2d..4b0b13c 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1664,13 +1664,14 @@ namespace OpenSim.Framework /// public static void PrintCallStack() { - StackTrace stackTrace = new StackTrace(); // get call stack + StackTrace stackTrace = new StackTrace(true); // get call stack StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames) // write call stack method names foreach (StackFrame stackFrame in stackFrames) { - m_log.Debug(stackFrame.GetMethod().DeclaringType + "." + stackFrame.GetMethod().Name); // write method name + MethodBase mb = stackFrame.GetMethod(); + m_log.DebugFormat("{0}.{1}:{2}", mb.DeclaringType, mb.Name, stackFrame.GetFileLineNumber()); // write method name } } -- cgit v1.1 From 71e484516a0323187077c734d5b30d2839ebab99 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 10 Feb 2012 23:41:14 +0000 Subject: minor: Remove warning from RegionInfo due to repeated config.GetString() call where the first was unused. --- OpenSim/Framework/RegionInfo.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 661b457..5ba3863 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -625,7 +625,6 @@ namespace OpenSim.Framework foreach (String s in allKeys) { - string val = config.GetString(s); SetOtherSetting(s, config.GetString(s)); } } -- cgit v1.1 From 5023cc86f095d7d3f25213ff63c4e1fcaf6c4e92 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 10 Feb 2012 23:52:06 +0000 Subject: Change parser to leave embedded quotes alone if the pattern is recognized as an OptionSet long option --- OpenSim/Framework/Console/CommandConsole.cs | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index a0d3541..0d6288b 100644 --- a/OpenSim/Framework/Console/CommandConsole.cs +++ b/OpenSim/Framework/Console/CommandConsole.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Text; +using System.Text.RegularExpressions; using System.Threading; using log4net; using OpenSim.Framework; @@ -531,6 +532,11 @@ namespace OpenSim.Framework.Console public class Parser { + // If an unquoted portion ends with an element matching this regex + // and the next element contains a space, then we have stripped + // embedded quotes that should not have been stripped + private static Regex optionRegex = new Regex("^--[a-zA-Z0-9-]+=$"); + public static string[] Parse(string text) { List result = new List(); @@ -544,10 +550,38 @@ namespace OpenSim.Framework.Console if (index % 2 == 0) { string[] words = unquoted[index].Split(new char[] {' '}); + + bool option = false; foreach (string w in words) { if (w != String.Empty) + { + if (optionRegex.Match(w) == Match.Empty) + option = false; + else + option = true; result.Add(w); + } + } + // The last item matched the regex, put the quotes back + if (option) + { + // If the line ended with it, don't do anything + if (index < (unquoted.Length - 1)) + { + // Get and remove the option name + string optionText = result[result.Count - 1]; + result.RemoveAt(result.Count - 1); + + // Add the quoted value back + optionText += "\"" + unquoted[index + 1] + "\""; + + // Push the result into our return array + result.Add(optionText); + + // Skip the already used value + index++; + } } } else -- cgit v1.1