aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
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;
}