From 874ebf8754486e3b0307b2a86e4c327693a9e78e Mon Sep 17 00:00:00 2001 From: zardoru Date: Sat, 31 Jan 2015 13:05:30 -0300 Subject: [PATCH] Allow arbitrary indentation on the BMS loader. --- src/NotesLoaderBMS.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/NotesLoaderBMS.cpp b/src/NotesLoaderBMS.cpp index 47b9f7bed8..ca6eedb97b 100644 --- a/src/NotesLoaderBMS.cpp +++ b/src/NotesLoaderBMS.cpp @@ -404,9 +404,17 @@ struct bmsCommandTree { line++; - if (statement.length() == 0 || statement[0] != '#') // Skip. + if (statement.length() == 0) // Skip. return; + // LTrim the statement to allow indentation + size_t hash = statement.find('#'); + + if (hash == RString::npos) + return; + + statement = statement.substr(hash); + size_t space = statement.find(' '); RString name = statement.substr(0, space); RString value = "";