aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--findutils/xargs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/findutils/xargs.c b/findutils/xargs.c
index 76c4747fe..e0fb369e8 100644
--- a/findutils/xargs.c
+++ b/findutils/xargs.c
@@ -65,6 +65,9 @@
65 65
66//kbuild:lib-$(CONFIG_XARGS) += xargs.o 66//kbuild:lib-$(CONFIG_XARGS) += xargs.o
67 67
68#if ENABLE_PLATFORM_MINGW32
69#include <conio.h>
70#endif
68#include "libbb.h" 71#include "libbb.h"
69 72
70/* This is a NOEXEC applet. Be very careful! */ 73/* This is a NOEXEC applet. Be very careful! */
@@ -403,13 +406,23 @@ static int xargs_ask_confirmation(void)
403 FILE *tty_stream; 406 FILE *tty_stream;
404 int c, savec; 407 int c, savec;
405 408
409#if !ENABLE_PLATFORM_MINGW32
406 tty_stream = xfopen_for_read(CURRENT_TTY); 410 tty_stream = xfopen_for_read(CURRENT_TTY);
411#endif
407 fputs(" ?...", stderr); 412 fputs(" ?...", stderr);
408 fflush_all(); 413 fflush_all();
414#if !ENABLE_PLATFORM_MINGW32
409 c = savec = getc(tty_stream); 415 c = savec = getc(tty_stream);
410 while (c != EOF && c != '\n') 416 while (c != EOF && c != '\n')
411 c = getc(tty_stream); 417 c = getc(tty_stream);
412 fclose(tty_stream); 418 fclose(tty_stream);
419#else
420 c = savec = getche();
421 while (c != EOF && c != '\r')
422 c = getche();
423 fputs("\n", stderr);
424 fflush_all();
425#endif
413 return (savec == 'y' || savec == 'Y'); 426 return (savec == 'y' || savec == 'Y');
414} 427}
415#else 428#else