From aaf8b07ecfaf1ea054736a1f86e37771bcfa8813 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 21 Feb 2009 11:48:50 +0000 Subject: [PATCH] Allow entry of '?' in http URIs. If the field being typed begins with "http", the ? is just an ordinary character in that field. --- OpenSim/Framework/Console/ConsoleBase.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index bd19800aa0..1f880625f2 100644 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs @@ -799,16 +799,25 @@ namespace OpenSim.Framework.Console } } - private void ContextHelp() + private bool ContextHelp() { string[] words = Parser.Parse(cmdline.ToString()); - string[] opts = Commands.FindNextOption(words, cmdline.ToString().EndsWith(" ")); + bool trailingSpace = cmdline.ToString().EndsWith(" "); + + // Allow ? through while typing a URI + // + if (words.Length > 0 && words[words.Length-1].StartsWith("http") && !trailingSpace) + return false; + + string[] opts = Commands.FindNextOption(words, trailingSpace); if (opts[0].StartsWith("Command help:")) Output(opts[0]); else Output(String.Format("Options: {0}", String.Join(" ", opts))); + + return true; } public void Prompt() @@ -923,8 +932,8 @@ namespace OpenSim.Framework.Console if (c == '?' && isCommand) { - ContextHelp(); - continue; + if (ContextHelp()) + continue; } cmdline.Insert(cp, c);