From 0095dd0812b566a4233812fc11a6a6f72c62d632 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 8 May 2024 00:46:31 +0000 Subject: [PATCH] fix repl git-svn-id: file:///raid/svn-main/nishi-serenade/trunk@119 0f02c867-ac3d-714e-8a88-971ba1f6efcf --- Serenade/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Serenade/main.c b/Serenade/main.c index 749a5d0..f41f25d 100644 --- a/Serenade/main.c +++ b/Serenade/main.c @@ -50,6 +50,7 @@ extern bool is_repl; #ifdef HAS_REPL_SUPPORT int run_command(const char* cmd) { + printf("!%s\n", cmd); if(strcmp(cmd, ":quit") == 0) { return 1; } else if(strcmp(cmd, ":version") == 0) { @@ -128,7 +129,7 @@ int main(int argc, char** argv) { sn_stdlib_init(sn); sn_module_init(sn); char cbuf[2]; - cbuf[0] = '\n'; + cbuf[0] = 0; cbuf[1] = 0; char* str = malloc(1); str[0] = 0; @@ -137,6 +138,9 @@ int main(int argc, char** argv) { char* line = NULL; using_history(); read_history(".serenade_history"); +#else + printf("> "); + fflush(stdout); #endif while(1) { #ifdef HAS_READLINE_SUPPORT @@ -203,7 +207,7 @@ int main(int argc, char** argv) { } if(cbuf[0] != '\r' && cbuf[0] != '\n') { char* tmp = str; - str = sn_strcat3(tmp, cbuf, "\n"); + str = sn_strcat(tmp, cbuf); free(tmp); } #endif -- 2.43.0