diff options
author | Ron Yorston <rmy@pobox.com> | 2023-03-05 12:33:01 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-03-05 12:33:01 +0000 |
commit | 9aef4d4d298987437e33bf25bcddd16175148d45 (patch) | |
tree | 172ada18bda876ec9041c74a3199d8a475e0fb3b /libbb | |
parent | 4020c7689c3f640e8a56edd1a1491403112857ec (diff) | |
download | busybox-w32-9aef4d4d298987437e33bf25bcddd16175148d45.tar.gz busybox-w32-9aef4d4d298987437e33bf25bcddd16175148d45.tar.bz2 busybox-w32-9aef4d4d298987437e33bf25bcddd16175148d45.zip |
win32: enable Unix read_key() for virtual terminal
Until now busybox-w32 has used a native Windows implementation
of read_key(). Build the upstream Unix implementation and use
it instead of the native version when virtual terminal input
mode is enabled.
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/Kbuild.src | 2 | ||||
-rw-r--r-- | libbb/read_key.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src index 191984c9d..425bfe1c6 100644 --- a/libbb/Kbuild.src +++ b/libbb/Kbuild.src | |||
@@ -64,6 +64,7 @@ lib-y += process_escape_sequence.o | |||
64 | lib-y += procps.o | 64 | lib-y += procps.o |
65 | lib-y += ptr_to_globals.o | 65 | lib-y += ptr_to_globals.o |
66 | lib-y += read.o | 66 | lib-y += read.o |
67 | lib-y += read_key.o | ||
67 | lib-y += read_printf.o | 68 | lib-y += read_printf.o |
68 | lib-y += recursive_action.o | 69 | lib-y += recursive_action.o |
69 | lib-y += remove_file.o | 70 | lib-y += remove_file.o |
@@ -114,7 +115,6 @@ lib-$(CONFIG_PLATFORM_POSIX) += perror_nomsg.o | |||
114 | lib-$(CONFIG_PLATFORM_POSIX) += pidfile.o | 115 | lib-$(CONFIG_PLATFORM_POSIX) += pidfile.o |
115 | lib-$(CONFIG_PLATFORM_POSIX) += print_flags.o | 116 | lib-$(CONFIG_PLATFORM_POSIX) += print_flags.o |
116 | lib-$(CONFIG_PLATFORM_POSIX) += progress.o | 117 | lib-$(CONFIG_PLATFORM_POSIX) += progress.o |
117 | lib-$(CONFIG_PLATFORM_POSIX) += read_key.o | ||
118 | lib-$(CONFIG_PLATFORM_POSIX) += setup_environment.o | 118 | lib-$(CONFIG_PLATFORM_POSIX) += setup_environment.o |
119 | lib-$(CONFIG_PLATFORM_POSIX) += signals.o | 119 | lib-$(CONFIG_PLATFORM_POSIX) += signals.o |
120 | lib-$(CONFIG_PLATFORM_POSIX) += speed_table.o | 120 | lib-$(CONFIG_PLATFORM_POSIX) += speed_table.o |
diff --git a/libbb/read_key.c b/libbb/read_key.c index cf8ed411e..c34770028 100644 --- a/libbb/read_key.c +++ b/libbb/read_key.c | |||
@@ -9,7 +9,11 @@ | |||
9 | */ | 9 | */ |
10 | #include "libbb.h" | 10 | #include "libbb.h" |
11 | 11 | ||
12 | #if ENABLE_PLATFORM_MINGW32 | ||
13 | int64_t FAST_FUNC unix_read_key(int fd, char *buffer, int timeout) | ||
14 | #else | ||
12 | int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout) | 15 | int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout) |
16 | #endif | ||
13 | { | 17 | { |
14 | struct pollfd pfd; | 18 | struct pollfd pfd; |
15 | const char *seq; | 19 | const char *seq; |