Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 525b4b3c46ea964a66f18c38c0d747367a1f1806
parent 72f8330b3f103f41993c9c6721fdd86fd42f8cb3
Author: Egg Milk Soup <egg@milksoup.net>
Date:   Thu,  9 Jun 2022 09:29:38 -0500

fix syntax error

the execCmdEx procedure does not in fact add whitespace.
actually it pipes whatever you set input equal to into the
shell command. the default argument of xargs is equal to
'echo', so the reason it worked on certain machines (???)
was that it was piping "10" into "xargs | bc".

bc reads from standard input, if you do "xargs bc", it pipes
10 into xargs, which executes "bc 10", and there's no file
named 10, obviously, so it returns nonzero, leading to an
unpredictable outcome.

Msrc/verb.nim | 5+----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/verb.nim b/src/verb.nim @@ -37,10 +37,7 @@ proc calculateModifier*(exp: string, sheet: YamlDocument): string = var working = exp if exp.contains(reProcessedExp): - # I think that execCmdEx adds whitespace in input; - # the xargs pipe first is necessary to prevent bc - # from throwing up - let (output, code) = execCmdEx("xargs | bc", input=exp) + let (output, code) = execCmdEx("bc", input=exp & '\n') if code == 0: working = output.strip return working