summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-04-01 17:56:53 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-04-01 18:01:45 (GMT)
commit632635e8ce905221ef4e68195e18e9cca26bb6c0 (patch)
treee688aa881894be992d299ce45f6e9603ba52715e
parent7612b22db5977d6e36f185a2de5cfe1424178879 (diff)
fix for nanoboxx, don't echo characters to stdout instead of terminal
-rw-r--r--nanobox.c8
1 files changed, 6 insertions, 2 deletions
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