[gnome-calculator] Return with failure exitcode in case of precision error (bgo#749336)
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator] Return with failure exitcode in case of precision error (bgo#749336)
- Date: Wed, 24 Jan 2018 00:13:51 +0000 (UTC)
commit c80831ecba06757736aab395f1301a2af5eb4468
Author: Robert Roth <robert roth off gmail com>
Date: Wed Jan 24 02:13:32 2018 +0200
Return with failure exitcode in case of precision error (bgo#749336)
src/gnome-calculator.vala | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/gnome-calculator.vala b/src/gnome-calculator.vala
index d5305bc..079ec6e 100644
--- a/src/gnome-calculator.vala
+++ b/src/gnome-calculator.vala
@@ -232,7 +232,13 @@ public class Calculator : Gtk.Application
{
var serializer = new Serializer (DisplayFormat.AUTOMATIC, 10, 9);
serializer.set_representation_base (representation_base);
- stdout.printf ("%s\n", serializer.to_string (result));
+ var eq_result = serializer.to_string (result);
+ if (serializer.error != null) {
+ stderr.printf (serializer.error);
+ return Posix.EXIT_FAILURE;
+ }
+
+ stdout.printf ("%s\n", eq_result);
return Posix.EXIT_SUCCESS;
}
else if (error == ErrorCode.MP)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]