diff --git a/ChangeLog b/ChangeLog index bce37901..076c0d48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2013-09-21 Bernhard Voelker + + xargs: wait for process before prompting in interactive mode (-p) + * xargs/xargs.c (xargs_do_exec): Move the code for waiting for + forked processes up, so that the child process terminates before + we prompt for the next command. + * NEWS: Mention the fix. + 2013-09-21 Dmitry V. Levin find: fix potential buffer overflow in -execdir and -okdir. diff --git a/NEWS b/NEWS index 78febdb1..a08ec912 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,8 @@ database, though they are in the ChangeLog: *** Don't delete header files in "lib/" for "make clean". +*** xargs: wait for process before prompting in interactive mode (-p) + These following fixed bugs are recorded at https://savannah.gnu.org/bugs/?group=findutils: diff --git a/xargs/xargs.c b/xargs/xargs.c index d773bde6..5e373f2b 100644 --- a/xargs/xargs.c +++ b/xargs/xargs.c @@ -1179,15 +1179,16 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char * (void) argc; (void) usercontext; + if (proc_max) + { + while (procs_executing >= proc_max) + { + wait_for_proc (false, 1u); + } + } + if (!query_before_executing || print_args (true)) { - if (proc_max) - { - while (procs_executing >= proc_max) - { - wait_for_proc (false, 1u); - } - } if (!query_before_executing && print_command) print_args (false);