aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/main/main.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index 125c189..17a5a90 100644
--- a/examples/main/main.cpp
+++ b/examples/main/main.cpp
@@ -551,12 +551,14 @@ int main(int argc, char ** argv) {
return 0;
}
#endif
- if (line.empty() || line.back() != '\\') {
- another_line = false;
- } else {
- line.pop_back(); // Remove the continue character
+ if (!line.empty()) {
+ if (line.back() == '\\') {
+ line.pop_back(); // Remove the continue character
+ } else {
+ another_line = false;
+ }
+ buffer += line + '\n'; // Append the line to the result
}
- buffer += line + '\n'; // Append the line to the result
} while (another_line);
// done taking input, reset color