Commit e7613241 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel

[Interpreter] Ignore empty command and Python comments.

parent 3204d735
......@@ -185,6 +185,13 @@ void Interpreter::python( const std::string& command, std::string& res,
out = "";
err = "";
// Check if the command is not a python comment or empty.
std::string::size_type iFirstNonWhite = command.find_first_not_of (" \t");
// Empty command
if (iFirstNonWhite == std::string::npos) return;
// Command is a comment. Ignore it.
if (command[iFirstNonWhite] == '#') return;
std::cout << command.c_str() << std::endl;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment