diff --git a/src/pebblisp.c b/src/pebblisp.c index 8eae15f..890eda3 100644 --- a/src/pebblisp.c +++ b/src/pebblisp.c @@ -11,14 +11,14 @@ #include #include -#include -#include - #include "tokens.h" #include "plfunc.h" #ifdef STANDALONE +#include +#include + #include "web.h" #endif @@ -600,7 +600,6 @@ void repl(struct Environment* env) { char* buf; using_history(); - parseEval("(def prompt \"pebblisp::> \")", env); while ((buf = readline(readFromEnvironment("prompt", env).string)) != NULL) { if (strcmp("q", buf) == 0) { free(buf); @@ -682,6 +681,13 @@ int main(int argc, const char* argv[]) sigaction(SIGSEGV, &action, NULL); readFile(SCRIPTDIR "/lib.pbl", &env); + + parseEval("(def prompt \"pebblisp::> \")", &env); + + char config[strlen(getenv("HOME")) + 15]; + sprintf(config, "%s/.pebblisp.pbl", getenv("HOME")); + readFile(config, &env); + if (argc >= 2) { FILE* file = fopen(argv[1], "r"); if (file) {