summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2025-11-27 15:42:55 +0100
committerGravatar Nikias Bassen2025-11-27 15:42:55 +0100
commitc4f111800d2b08d6c65ec075ad49c4a60e9e4309 (patch)
tree1e295aba9f0ce2661f5c8a5116b9b5f9af69aac8
parent5173265fb42adf32f20e80730d0830008a2c6889 (diff)
downloadlibimobiledevice-c4f111800d2b08d6c65ec075ad49c4a60e9e4309.tar.gz
libimobiledevice-c4f111800d2b08d6c65ec075ad49c4a60e9e4309.tar.bz2
afcclient: Fix text echoing on WindowsHEADmaster
-rw-r--r--tools/afcclient.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/afcclient.c b/tools/afcclient.c
index 8e12b3c..2667e52 100644
--- a/tools/afcclient.c
+++ b/tools/afcclient.c
@@ -141,6 +141,7 @@ static void print_usage(int argc, char **argv, int is_error)
141#ifndef HAVE_READLINE 141#ifndef HAVE_READLINE
142#ifdef _WIN32 142#ifdef _WIN32
143#define BS_CC '\b' 143#define BS_CC '\b'
144#define getch _getch
144#else 145#else
145#define BS_CC 0x7f 146#define BS_CC 0x7f
146#define getch getchar 147#define getch getchar
@@ -155,12 +156,18 @@ static void get_input(char *buf, int maxlen)
155 break; 156 break;
156 } 157 }
157 if (isprint(c)) { 158 if (isprint(c)) {
158 if (len < maxlen-1) 159 if (len < maxlen-1) {
159 buf[len++] = c; 160 buf[len++] = c;
161#ifdef _WIN32
162 fputc(c, stdout);
163#endif
164 }
160 } else if (c == BS_CC) { 165 } else if (c == BS_CC) {
161 if (len > 0) { 166 if (len > 0) {
162 fputs("\b \b", stdout); 167 fputs("\b \b", stdout);
163 len--; 168 len--;
169 } else {
170 fputc(0x07, stdout);
164 } 171 }
165 } 172 }
166 } 173 }