aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2024-01-28 19:55:11 -0800
committerPreston Pan <preston@nullring.xyz>2024-01-28 19:55:11 -0800
commit1e95a76aa28df41b36c1ec41e24287d6c1b4065b (patch)
tree8f7a4aa5867369f17fa347fdad759413c8bd0ba9
parent9d84cacb1ccdc9822d16f0fb5531f79d5770349f (diff)
fix bugs found by emailer
-rw-r--r--Makefile2
-rw-r--r--README.md2
-rw-r--r--src/builtins.c5
-rw-r--r--src/stem.c2
4 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index c24ca25..242e93f 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ clean:
install:
cp $(TARGET) /usr/local/bin/
- mkdir -p /usr/local/lib/share/stem/
+ mkdir -p /usr/local/share/stem/
cp -r stemlib/ /usr/local/share/stem/
doc:
diff --git a/README.md b/README.md
index 968104b..b483ac4 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ choices along the way in the design process according to what I thought was logi
# Installation
In the terminal:
``` sh
-git clone https://github.com/ret2pop/stem
+git clone --recurse-submodules https://github.com/ret2pop/stem
cd stem/
make
sudo make install
diff --git a/src/builtins.c b/src/builtins.c
index bf8618a..4446cb8 100644
--- a/src/builtins.c
+++ b/src/builtins.c
@@ -311,7 +311,7 @@ void stemsin(value_t *v) {
array_append(STACK, v1);
eval_error("INVALID TYPE ARGUMENT");
}
- v1->int_float = sinhl(v1->int_float);
+ v1->int_float = sinl(v1->int_float);
array_append(STACK, v1);
}
@@ -325,7 +325,7 @@ void stemcos(value_t *v) {
array_append(STACK, v1);
eval_error("INVALID TYPE ARGUMENT");
}
- v1->int_float = coshl(v1->int_float);
+ v1->int_float = cosl(v1->int_float);
array_append(STACK, v1);
}
@@ -558,6 +558,7 @@ void stemfread(value_t *v) {
void stemread(value_t *v) {
value_t *retval = init_value(VSTR);
char *a = get_line(stdin);
+ clearerr(stdin);
retval->str_word = init_string(a);
array_append(STACK, retval);
free(a);
diff --git a/src/stem.c b/src/stem.c
index f623ae7..651d624 100644
--- a/src/stem.c
+++ b/src/stem.c
@@ -331,6 +331,8 @@ value_t *parser_get_next(parser_t *p) {
return parse_quote(p);
case '\0':
return NULL;
+ case EOF:
+ return NULL;
default:
return parse_word(p);
}