aboutsummaryrefslogtreecommitdiff
path: root/findutils/xargs.c
diff options
context:
space:
mode:
Diffstat (limited to 'findutils/xargs.c')
-rw-r--r--findutils/xargs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/findutils/xargs.c b/findutils/xargs.c
index 2d0d1c8b9..e5384d14c 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#include "common_bufsiz.h" 72#include "common_bufsiz.h"
70 73
@@ -405,13 +408,23 @@ static int xargs_ask_confirmation(void)
405 FILE *tty_stream; 408 FILE *tty_stream;
406 int c, savec; 409 int c, savec;
407 410
411#if !ENABLE_PLATFORM_MINGW32
408 tty_stream = xfopen_for_read(CURRENT_TTY); 412 tty_stream = xfopen_for_read(CURRENT_TTY);
413#endif
409 fputs(" ?...", stderr); 414 fputs(" ?...", stderr);
410 fflush_all(); 415 fflush_all();
416#if !ENABLE_PLATFORM_MINGW32
411 c = savec = getc(tty_stream); 417 c = savec = getc(tty_stream);
412 while (c != EOF && c != '\n') 418 while (c != EOF && c != '\n')
413 c = getc(tty_stream); 419 c = getc(tty_stream);
414 fclose(tty_stream); 420 fclose(tty_stream);
421#else
422 c = savec = getche();
423 while (c != EOF && c != '\r')
424 c = getche();
425 fputs("\n", stderr);
426 fflush_all();
427#endif
415 return (savec == 'y' || savec == 'Y'); 428 return (savec == 'y' || savec == 'Y');
416} 429}
417#else 430#else