summaryrefslogtreecommitdiff
path: root/findutils
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--findutils/grep.c8
-rw-r--r--findutils/xargs.c13
2 files changed, 21 insertions, 0 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index b9621384e..0336b2927 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -179,6 +179,14 @@ enum {
179#define PRINT_FILES_WITHOUT_MATCHES (option_mask32 & OPT_L) 179#define PRINT_FILES_WITHOUT_MATCHES (option_mask32 & OPT_L)
180#define NUL_DELIMITED (option_mask32 & OPT_z) 180#define NUL_DELIMITED (option_mask32 & OPT_z)
181 181
182#if ENABLE_PLATFORM_MINGW32
183# define RE_TRANSLATE_TYPE unsigned char*
184# undef ENABLE_EXTRA_COMPAT
185# define ENABLE_EXTRA_COMPAT 0
186# undef IF_EXTRA_COMPAT
187# define IF_EXTRA_COMPAT(x)
188#endif
189
182struct globals { 190struct globals {
183 int max_matches; 191 int max_matches;
184#if !ENABLE_EXTRA_COMPAT 192#if !ENABLE_EXTRA_COMPAT
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