aboutsummaryrefslogtreecommitdiff
path: root/findutils/xargs.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-04-09 08:50:34 +0100
committerRon Yorston <rmy@pobox.com>2018-04-09 08:50:34 +0100
commit921c1ab66bad54d4ad8591bb74e41ac985248496 (patch)
tree552a04c691e78e78570e4ec2c83fbc0e59953924 /findutils/xargs.c
parent5b6f06f5eb8628955262508d153627fe6f2d1c8b (diff)
parenta1870f4807a75663a085c9f5e92870fa7554f0ad (diff)
downloadbusybox-w32-921c1ab66bad54d4ad8591bb74e41ac985248496.tar.gz
busybox-w32-921c1ab66bad54d4ad8591bb74e41ac985248496.tar.bz2
busybox-w32-921c1ab66bad54d4ad8591bb74e41ac985248496.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'findutils/xargs.c')
-rw-r--r--findutils/xargs.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/findutils/xargs.c b/findutils/xargs.c
index 9e475d7e6..df2300207 100644
--- a/findutils/xargs.c
+++ b/findutils/xargs.c
@@ -570,27 +570,28 @@ static int xargs_ask_confirmation(void)
570{ 570{
571#if !ENABLE_PLATFORM_MINGW32 571#if !ENABLE_PLATFORM_MINGW32
572 FILE *tty_stream; 572 FILE *tty_stream;
573#endif 573 int r;
574 int c, savec;
575 574
576#if !ENABLE_PLATFORM_MINGW32
577 tty_stream = xfopen_for_read(CURRENT_TTY); 575 tty_stream = xfopen_for_read(CURRENT_TTY);
578#endif 576
579 fputs(" ?...", stderr); 577 fputs(" ?...", stderr);
580 fflush_all(); 578 r = bb_ask_y_confirmation_FILE(tty_stream);
581#if !ENABLE_PLATFORM_MINGW32 579
582 c = savec = getc(tty_stream);
583 while (c != EOF && c != '\n')
584 c = getc(tty_stream);
585 fclose(tty_stream); 580 fclose(tty_stream);
586#else 581#else
582 int r, c, savec;
583
584 fputs(" ?...", stderr);
585 fflush_all();
587 c = savec = getche(); 586 c = savec = getche();
588 while (c != EOF && c != '\r') 587 while (c != EOF && c != '\r')
589 c = getche(); 588 c = getche();
590 fputs("\n", stderr); 589 fputs("\n", stderr);
591 fflush_all(); 590 fflush_all();
591 r = (savec == 'y' || savec == 'Y');
592#endif 592#endif
593 return (savec == 'y' || savec == 'Y'); 593
594 return r;
594} 595}
595#else 596#else
596# define xargs_ask_confirmation() 1 597# define xargs_ask_confirmation() 1