diff options
author | Aaron Seigo <aseigo@kde.org> | 2015-12-26 19:36:16 +0100 |
---|---|---|
committer | Aaron Seigo <aseigo@kde.org> | 2015-12-26 19:36:16 +0100 |
commit | 08bdecf2d3c938032312f6ede3662157f83013eb (patch) | |
tree | 9c32c13f272663f70f857f9d27bb42ea0667ac1d | |
parent | 9ac72f34268e5ca929f100acf9b00d62f7c49366 (diff) | |
download | sink-08bdecf2d3c938032312f6ede3662157f83013eb.tar.gz sink-08bdecf2d3c938032312f6ede3662157f83013eb.zip |
trim lines, ignore empty ones
-rw-r--r-- | akonadish/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/akonadish/main.cpp b/akonadish/main.cpp index fe8494b..45bd5ea 100644 --- a/akonadish/main.cpp +++ b/akonadish/main.cpp | |||
@@ -71,14 +71,14 @@ int main(int argc, char *argv[]) | |||
71 | return 1; | 71 | return 1; |
72 | } | 72 | } |
73 | 73 | ||
74 | QString line = f.readLine(); | 74 | QString line = f.readLine().trimmed(); |
75 | while (!line.isEmpty()) { | 75 | while (!line.isEmpty()) { |
76 | if (line.startsWith('#')) { | 76 | if (line.isEmpty() || line.startsWith('#')) { |
77 | line = f.readLine(); | 77 | line = f.readLine().trimmed(); |
78 | continue; | 78 | continue; |
79 | } | 79 | } |
80 | SyntaxTree::self()->run(SyntaxTree::tokenize(line)); | 80 | SyntaxTree::self()->run(SyntaxTree::tokenize(line)); |
81 | line = f.readLine(); | 81 | line = f.readLine().trimmed(); |
82 | } | 82 | } |
83 | exit(0); | 83 | exit(0); |
84 | } else if (!interactive) { | 84 | } else if (!interactive) { |