From 4c5b6a528240482b13e1c334995a5fd51a026fdb Mon Sep 17 00:00:00 2001 From: expwnent Date: Mon, 26 Jan 2015 19:24:31 -0500 Subject: [PATCH] For multiline comments, delete the backslash instead of changing it to a space. --- Readme.rst | 2 +- dfhack.init-example | 2 +- library/Core.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Readme.rst b/Readme.rst index 3965e2282..27592955d 100644 --- a/Readme.rst +++ b/Readme.rst @@ -242,7 +242,7 @@ To include a double quote character, use ``\"`` inside double quotes. If the first non-whitespace character of a line is ``#``, the line is treated as a comment, i.e. a silent no-op command. -When reading commands from dfhack.init or with the ``script`` command, if the final character on a line is a backslash then the next uncommented line is considered a continuation of that line, with the backslash converted to a space character. +When reading commands from dfhack.init or with the ``script`` command, if the final character on a line is a backslash then the next uncommented line is considered a continuation of that line, with the backslash deleted. Commented lines are skipped, so it is possible to comment out parts of a command with the ``#`` character. If the first non-whitespace character is ``:``, the command is parsed in a special diff --git a/dfhack.init-example b/dfhack.init-example index caaa9dd75..adadfb6b5 100644 --- a/dfhack.init-example +++ b/dfhack.init-example @@ -208,7 +208,7 @@ enable \ stocks \ autochop \ stockpiles -#end a line with a backslash to make it continue to the next line. The \ is converted to a space for the final command. +#end a line with a backslash to make it continue to the next line. The \ is deleted for the final command. # Multiline commands are ONLY supported for scripts like dfhack.init. You cannot do multiline command manually on the DFHack console. # You cannot extend a commented line. # You can comment out the extension of a line. diff --git a/library/Core.cpp b/library/Core.cpp index f2a86444f..0099d2cc0 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -842,7 +842,7 @@ bool Core::loadScriptFile(color_ostream &out, string fname, bool silent) temp = temp.substr(0,temp.length()-1); if ( temp.length() > 0 ) { if ( temp[temp.length()-1] == '\\' ) { - temp[temp.length()-1] = ' '; + temp = temp.substr(0,temp.length()-1); doMore = true; } }