On Mon, 6 Jun 2016 22:45:27 +0800, Herbert Xu <[email protected]> wrote: > On Fri, Jun 03, 2016 at 09:54:31AM +0200, Stephen Kitt wrote: > > When looking for a job using a string descriptor, e.g. > > > > fg %man > > > > the relevant loop in src/jobs.c only ever exits to the err label. With > > this patch, when the end condition is reached, we check whether a job > > was found, and if so, set things up to exit correctly via gotit. > > Multiple matches are already caught using the test in the match block. > > > > Signed-off-by: Stephen Kitt <[email protected]> > > Thanks for the patch. I'd prefer to move that logic out of the > loop, like this: [...]
> - while (1) {
> - if (!jp)
> - goto err;
> + while (jp) {
[...]
That is indeed much better, thanks!
Regards,
Stephen
pgpJITcLL_dmj.pgp
Description: OpenPGP digital signature
