Fix a bug found by mathieu, a FreeBSD user
This bug was reported in https://git.yzena.com/gavin/bc/issues/10. It happens when the first thing a user enters at `stdin` causes a parse error. mathieu did not know what caused the error, and I could not reproduce it on my machine. I tried on FreeBSD and could reproduce it under root, but not my user. After investigating, the reason I could not reproduce it was because my user runs a file: /home/gavin/.bcrc. Because it runs the file, it would execute the `scale = 20` statement in the math library. However, when I would not have it execute that file, and enter a parse error first, that statement would not be executed, and since bc resets after an error, that statement would disappear and never happen. The fix was simple: just call bc_program_exec() right after loading the math libraries. Fix #10
This commit is contained in:
parent
21ed9fa62b
commit
299a4fd353
Loadingâ¦
Reference in New Issue