From cc302bc17c515f20b72a2dc6db227159468c5495 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Thu, 25 May 2017 13:50:42 +0200
Subject: Fix "-"
---
ell.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/ell.c b/ell.c
index 8234432..b221393 100644
--- a/ell.c
+++ b/ell.c
@@ -1055,7 +1055,12 @@ defn (fn_plus) {
}
defn (fn_minus) {
- double res = 0.0;
+ if (!args || args->type != ITEM_STRING)
+ return set_error (ctx, "first argument must be string");
+ double res = strtod (args->value, NULL);
+ if (!(args = args->next))
+ res = -res;
+
for (; args; args = args->next) {
if (args->type != ITEM_STRING)
return set_error (ctx, "arguments must be strings");
--
cgit v1.2.3-70-g09d2