From d2ed06e2dcdc413f900b98582a3b190c70fa748a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 11 Sep 2018 17:02:00 +0200 Subject: [PATCH] [code] Add comment on how --code-script option is parsed --- apps/code/app.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/code/app.cpp b/apps/code/app.cpp index 301cc8b5d..256bec485 100644 --- a/apps/code/app.cpp +++ b/apps/code/app.cpp @@ -57,6 +57,11 @@ void App::Snapshot::setOpt(const char * name, char * value) { } *separator = 0; const char * scriptName = value; + /* We include the 0 in the scriptContent to represent the importation + * status. It is set to 1 after addScriptFromTemplate. Indeed, this '/0' + * char has two goals: ending the scriptName and representing the + * importation status; we cannot set it to 1 before adding the script to + * storage. */ const char * scriptContent = separator; Code::ScriptTemplate script(scriptName, scriptContent); m_scriptStore.addScriptFromTemplate(&script);