diff options
author | Alex Auvolat <alex@adnab.me> | 2017-01-26 17:43:38 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2017-01-26 17:43:38 +0100 |
commit | 96da27494f89d75f8aec0c8894440c3f7482f54b (patch) | |
tree | a239f75acf6c2c11cfa54b895653f978980064cb /src/lib | |
parent | 809d660944cfb515e18bb7f1c1519392b4bccd53 (diff) | |
download | kogata-96da27494f89d75f8aec0c8894440c3f7482f54b.tar.gz kogata-96da27494f89d75f8aec0c8894440c3f7482f54b.zip |
More lua
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libc/stdio.c | 2 | ||||
-rw-r--r-- | src/lib/libc/stdlib.c | 5 |
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; } |