[gnome-calculator] Print newline on EOF from commandline.



commit 46858b484ea96e976ad5da3b84d298ce7758babf
Author: PioneerAxon <arth svnit gmail com>
Date:   Thu May 29 14:34:53 2014 +0530

    Print newline on EOF from commandline.

 src/gcalccmd.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gcalccmd.vala b/src/gcalccmd.vala
index 6326fe9..f447702 100644
--- a/src/gcalccmd.vala
+++ b/src/gcalccmd.vala
@@ -41,6 +41,8 @@ public static int main (string[] args)
 {
     /* Seed random number generator. */
     var now = new DateTime.now_utc ();
+    bool requires_new_line = false;
+
     Random.set_seed (now.get_microsecond ());
 
     Intl.setlocale (LocaleCategory.ALL, "");
@@ -55,11 +57,17 @@ public static int main (string[] args)
 
         if (line != null)
             line = line.strip ();
+        else
+            requires_new_line = true;
+
         if (line == null || line == "exit" || line == "quit" || line == "")
             break;
 
         solve (line);
     }
 
+    if (requires_new_line)
+        stdout.printf ("\n");
+
     return Posix.EXIT_SUCCESS;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]