aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2017-01-26 17:43:38 +0100
committerAlex Auvolat <alex@adnab.me>2017-01-26 17:43:38 +0100
commit96da27494f89d75f8aec0c8894440c3f7482f54b (patch)
treea239f75acf6c2c11cfa54b895653f978980064cb /src/lib
parent809d660944cfb515e18bb7f1c1519392b4bccd53 (diff)
downloadkogata-96da27494f89d75f8aec0c8894440c3f7482f54b.tar.gz
kogata-96da27494f89d75f8aec0c8894440c3f7482f54b.zip
More lua
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/stdio.c2
-rw-r--r--src/lib/libc/stdlib.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/libc/stdio.c b/src/lib/libc/stdio.c
index d90c30b..dcbcf83 100644
--- a/src/lib/libc/stdio.c
+++ b/src/lib/libc/stdio.c
@@ -238,7 +238,7 @@ int fgetc(FILE *stream) {
}
}
char *fgets(char *s, int size, FILE *stream) {
- dbg_printf("FGETS %p\n", stream);
+ dbg_printf("FGETS %p %d\n", stream, size);
int l = 0;
while (l < size - 1) {
diff --git a/src/lib/libc/stdlib.c b/src/lib/libc/stdlib.c
index bc543be..6b200c2 100644
--- a/src/lib/libc/stdlib.c
+++ b/src/lib/libc/stdlib.c
@@ -1,5 +1,6 @@
#include <stdlib.h>
#include <ctype.h>
+#include <string.h>
#include <kogata/debug.h>
@@ -75,6 +76,10 @@ double strtod(const char *nptr, char **endptr) {
}
char *getenv(const char *name) {
+ // HACK
+ if (!strcmp(name, "LUA_INIT")) {
+ return "require 'init'";
+ }
// TODO
return 0;
}