[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [akonadi-next/develop] akonadish: trim lines, ignore empty ones
From:       Aaron Seigo <aseigo () kde ! org>
Date:       2015-12-26 18:41:05
Message-ID: E1aCtm5-0000nD-0I () scm ! kde ! org
[Download RAW message or body]

Git commit 08bdecf2d3c938032312f6ede3662157f83013eb by Aaron Seigo.
Committed on 26/12/2015 at 18:36.
Pushed by aseigo into branch 'develop'.

trim lines, ignore empty ones

M  +4    -4    akonadish/main.cpp

http://commits.kde.org/akonadi-next/08bdecf2d3c938032312f6ede3662157f83013eb

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[])
             return 1;
         }
 
-        QString line = f.readLine();
+        QString line = f.readLine().trimmed();
         while (!line.isEmpty()) {
-            if (line.startsWith('#')) {
-                line = f.readLine();
+            if (line.isEmpty() || line.startsWith('#')) {
+                line = f.readLine().trimmed();
                 continue;
             }
             SyntaxTree::self()->run(SyntaxTree::tokenize(line));
-            line = f.readLine();
+            line = f.readLine().trimmed();
         }
         exit(0);
     } else if (!interactive) {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic