From 632635e8ce905221ef4e68195e18e9cca26bb6c0 Mon Sep 17 00:00:00 2001 From: Michele Bini Date: Fri, 1 Apr 2022 19:56:53 +0200 Subject: fix for nanoboxx, don't echo characters to stdout instead of terminal diff --git a/nanobox.c b/nanobox.c index 3847965..1ff34d4 100644 --- a/nanobox.c +++ b/nanobox.c @@ -261,7 +261,6 @@ int FAST_FUNC set_termios_to_raw(int fd, struct termios *oldterm, int flags); int FAST_FUNC tcsetattr_stdin_TCSANOW(const struct termios *tp); int safe_poll(struct pollfd *ufds, nfds_t nfds, int timeout_ms) FAST_FUNC; void FAST_FUNC bb_error_msg_and_die(const char *s, ...); -#define bb_putchar putchar ssize_t FAST_FUNC full_read(int fd, void *buf, size_t len); ssize_t FAST_FUNC full_write(int fd, const void *buf, size_t len); static int wh_helper(int value, int def_val, const char *env_name, int *err); @@ -680,6 +679,11 @@ int nano_stdin_fd; # define NANO_STDIN_FD STDIN_FILENO #endif +static void write_char(const char c) +{ + fputc(c, NANO_STDOUT); +} + static void write1(const char *out) { fputs(out, NANO_STDOUT); @@ -2107,7 +2111,7 @@ static char *get_input_line(const char *prompt, const char *value) #endif buf[i] = c; buf[++i] = '\0'; - bb_putchar(c); + write_char(c); #if 0 // ENABLE_FEATURE_NANO_UTF8 ditto } while (--char_len > 0); #endif -- cgit v0.10.2