Skip to content

Commit

Permalink
fix: remove double lua prompt on zenroom interactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-cristino authored and jaromil committed Jan 8, 2025
1 parent 988674f commit 7e754b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/repl.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ size_t repl_prompt(int ret, char *line) {
char *prompt;
if(ret) prompt="lua! \0";
else prompt="lua> \0";
int nop = write(STDOUT_FILENO, prompt, 5);
(void)nop;
#ifdef ARCH_LINUX
char *r = NULL;
r = readline(prompt);
if(!r) return 0; // quit
len = strlen(r);
memcpy(line, r, len);
#else
int nop = write(STDOUT_FILENO, prompt, 5);
(void)nop;
len = read(STDIN_FILENO, line, MAX_STRING);
#endif
line[len] = '\0';
Expand Down

0 comments on commit 7e754b9

Please sign in to comment.