Allow comments to appear in command scripts (e.g. shutdown_commands.txt).

These can start with ; # or //
0.7.4.1
Justin Clark-Casey (justincc) 2012-03-16 02:07:26 +00:00
parent 34f6f87b6c
commit aa881e8065
1 changed files with 5 additions and 1 deletions

View File

@ -503,7 +503,11 @@ namespace OpenSim
string currentCommand; string currentCommand;
while ((currentCommand = readFile.ReadLine()) != null) while ((currentCommand = readFile.ReadLine()) != null)
{ {
if (currentCommand != String.Empty) currentCommand = currentCommand.Trim();
if (!(currentCommand == ""
|| currentCommand.StartsWith(";")
|| currentCommand.StartsWith("//")
|| currentCommand.StartsWith("#")))
{ {
m_log.Info("[COMMANDFILE]: Running '" + currentCommand + "'"); m_log.Info("[COMMANDFILE]: Running '" + currentCommand + "'");
m_console.RunCommand(currentCommand); m_console.RunCommand(currentCommand);